Search in sources :

Example 11 with TemplateReport

use of io.jmix.emailtemplates.entity.TemplateReport in project jmix by jmix-framework.

the class EmailTemplateAttachmentsFragment method createTemplateReport.

protected TemplateReport createTemplateReport(Report report) {
    Report reloaded = reloadReport(report);
    TemplateReport templateReport = dataManager.create(TemplateReport.class);
    templateReport.setReport(reloaded);
    templateReport.setEmailTemplate(emailTemplateDc.getItem());
    templateReport.setParameterValues(new ArrayList<>());
    return templateReport;
}
Also used : TemplateReport(io.jmix.emailtemplates.entity.TemplateReport) Report(io.jmix.reports.entity.Report) TemplateReport(io.jmix.emailtemplates.entity.TemplateReport)

Example 12 with TemplateReport

use of io.jmix.emailtemplates.entity.TemplateReport in project jmix by jmix-framework.

the class EmailTemplateAttachmentsFragment method attachedReportsDcOnItemChangeEvent.

@Subscribe(id = "attachedReportsDc", target = Target.DATA_CONTAINER)
protected void attachedReportsDcOnItemChangeEvent(InstanceContainer.ItemChangeEvent<TemplateReport> e) {
    TemplateReport templateReport = e.getItem();
    if (templateReport != null) {
        parametersFragment.setTemplateReport(templateReport);
        parametersFragment.createComponents();
        attachmentGroup.setVisible(true);
    } else {
        parametersFragment.clearComponents();
        attachmentGroup.setVisible(false);
    }
}
Also used : TemplateReport(io.jmix.emailtemplates.entity.TemplateReport)

Aggregations

TemplateReport (io.jmix.emailtemplates.entity.TemplateReport)12 Report (io.jmix.reports.entity.Report)4 ReportWithParams (io.jmix.emailtemplates.dto.ReportWithParams)3 ParameterValue (io.jmix.emailtemplates.entity.ParameterValue)3 ArrayList (java.util.ArrayList)2 EmailTemplate (io.jmix.emailtemplates.entity.EmailTemplate)1 JsonEmailTemplate (io.jmix.emailtemplates.entity.JsonEmailTemplate)1 ReportEmailTemplate (io.jmix.emailtemplates.entity.ReportEmailTemplate)1 ReportParameterTypeChangedException (io.jmix.emailtemplates.exception.ReportParameterTypeChangedException)1 ReportInputParameter (io.jmix.reports.entity.ReportInputParameter)1