Search in sources :

Example 6 with JmixTableData

use of io.jmix.reports.entity.JmixTableData in project jmix by jmix-framework.

the class ShowReportTableScreen method printReport.

@Subscribe("printReportBtn")
protected void printReport(Button.ClickEvent button) {
    if (inputParametersFrame != null && inputParametersFrame.getReport() != null) {
        ValidationErrors validationErrors = screenValidation.validateUiComponents(getWindow());
        if (validationErrors.isEmpty()) {
            Map<String, Object> parameters = inputParametersFrame.collectParameters();
            Report report = inputParametersFrame.getReport();
            if (templateCode == null || templateCode.isEmpty())
                templateCode = findTableCode(report);
            ReportOutputDocument reportResult = reportRunner.byReportEntity(report).withParams(parameters).withTemplateCode(templateCode).run();
            JmixTableData dto = (JmixTableData) serialization.deserialize(reportResult.getContent());
            drawTables(dto);
        } else {
            screenValidation.showValidationErrors(this, validationErrors);
        }
    }
}
Also used : ReportOutputDocument(com.haulmont.yarg.reporting.ReportOutputDocument) Report(io.jmix.reports.entity.Report) JmixTableData(io.jmix.reports.entity.JmixTableData)

Example 7 with JmixTableData

use of io.jmix.reports.entity.JmixTableData in project jmix by jmix-framework.

the class ShowReportTableScreen method onBeforeShow.

@Subscribe
protected void onBeforeShow(BeforeShowEvent event) {
    reportsDl.load();
    if (report != null) {
        reportSelectorBox.setVisible(false);
        JmixTableData dto = (JmixTableData) serialization.deserialize(tableData);
        drawTables(dto);
        openReportParameters(reportParameters);
    }
}
Also used : JmixTableData(io.jmix.reports.entity.JmixTableData)

Aggregations

JmixTableData (io.jmix.reports.entity.JmixTableData)7 KeyValueEntity (io.jmix.core.entity.KeyValueEntity)2 EntityMap (io.jmix.reports.app.EntityMap)2 ReportOutputDocument (com.haulmont.yarg.reporting.ReportOutputDocument)1 BandData (com.haulmont.yarg.structure.BandData)1 Report (io.jmix.reports.entity.Report)1 ReportTemplate (io.jmix.reports.entity.ReportTemplate)1 TemplateTableBand (io.jmix.reports.entity.table.TemplateTableBand)1 TemplateTableColumn (io.jmix.reports.entity.table.TemplateTableColumn)1 TemplateTableDescription (io.jmix.reports.entity.table.TemplateTableDescription)1 ReportingException (io.jmix.reports.exception.ReportingException)1 KeyValueCollectionContainer (io.jmix.ui.model.KeyValueCollectionContainer)1 IOException (java.io.IOException)1 List (java.util.List)1 Set (java.util.Set)1