Search in sources :

Example 1 with UiReportRunContext

use of io.jmix.reportsui.runner.UiReportRunContext in project jmix-docs by Haulmont.

the class RunReportScreen method onUrrBtn1Click.

// end::rr-btn2-end[]
@Subscribe("urrBtn1")
protected void onUrrBtn1Click(Button.ClickEvent event) {
    Report report = getReportByCode("BOOK_COUNT");
    // tag::run-and-show[]
    uiReportRunner.runAndShow(new UiReportRunContext(report));
// end::run-and-show[]
}
Also used : UiReportRunContext(io.jmix.reportsui.runner.UiReportRunContext) Report(io.jmix.reports.entity.Report) Subscribe(io.jmix.ui.screen.Subscribe)

Example 2 with UiReportRunContext

use of io.jmix.reportsui.runner.UiReportRunContext in project jmix by jmix-framework.

the class RunReportAction method runReports.

protected void runReports(Collection<Report> reports, FrameOwner screen) {
    if (CollectionUtils.isNotEmpty(reports)) {
        Report report = reports.iterator().next();
        report = dataManager.load(Id.of(report)).fetchPlan("report.edit").one();
        if (report.getInputParameters() != null && report.getInputParameters().size() > 0 || inputParametersRequiredByTemplates(report)) {
            openReportParamsDialog(report, screen);
        } else {
            uiReportRunner.runAndShow(new UiReportRunContext(report).setInBackground(reportsClientProperties.getUseBackgroundReportProcessing()).setOriginFrameOwner(screen).setParametersDialogShowMode(ParametersDialogShowMode.NO).setParams(Collections.emptyMap()));
        }
    }
}
Also used : UiReportRunContext(io.jmix.reportsui.runner.UiReportRunContext) Report(io.jmix.reports.entity.Report)

Aggregations

Report (io.jmix.reports.entity.Report)2 UiReportRunContext (io.jmix.reportsui.runner.UiReportRunContext)2 Subscribe (io.jmix.ui.screen.Subscribe)1