Search in sources :

Example 26 with ReportTemplate

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

the class ReportRunnerImpl method prepareContext.

protected void prepareContext(ReportRunContext context) {
    Report report = context.getReport();
    context.setReport(reportsUtils.reloadReportIfNeeded(report, "report.edit"));
    ReportTemplate template = context.getReportTemplate();
    if (template == null) {
        template = getDefaultTemplate(report);
        context.setReportTemplate(template);
    }
    if (!entityStates.isLoadedWithFetchPlan(template, "template.edit")) {
        template = dataManager.load(Id.of(template)).fetchPlan("template.edit").one();
        context.setReportTemplate(template);
    }
}
Also used : Report(io.jmix.reports.entity.Report) ReportTemplate(io.jmix.reports.entity.ReportTemplate)

Aggregations

ReportTemplate (io.jmix.reports.entity.ReportTemplate)26 Report (io.jmix.reports.entity.Report)14 ReportOutputType (io.jmix.reports.entity.ReportOutputType)6 ReportOutputDocument (com.haulmont.yarg.reporting.ReportOutputDocument)4 Subscribe (io.jmix.ui.screen.Subscribe)3 List (java.util.List)3 DataManager (io.jmix.core.DataManager)2 PivotTableData (io.jmix.reports.entity.PivotTableData)2 ReportRunContext (io.jmix.reports.runner.ReportRunContext)2 HashMap (java.util.HashMap)2 Collectors (java.util.stream.Collectors)2 ZipArchiveEntry (org.apache.commons.compress.archivers.zip.ZipArchiveEntry)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 OpenOfficeException (com.haulmont.yarg.exception.OpenOfficeException)1 ReportingInterruptedException (com.haulmont.yarg.exception.ReportingInterruptedException)1 NoFreePortsException (com.haulmont.yarg.formatters.impl.doc.connector.NoFreePortsException)1 ReportingAPI (com.haulmont.yarg.reporting.ReportingAPI)1 RunParams (com.haulmont.yarg.reporting.RunParams)1 EntityStates (io.jmix.core.EntityStates)1 Id (io.jmix.core.Id)1