@UIScope @Component(value="report_UiReportRunner") public class UiReportRunnerImpl extends java.lang.Object implements UiReportRunner
Modifier and Type | Field and Description |
---|---|
protected io.jmix.ui.Dialogs |
dialogs |
protected io.jmix.ui.download.Downloader |
downloader |
protected org.springframework.beans.factory.ObjectProvider<FluentUiReportRunner> |
fluentUiReportRunners |
protected io.jmix.core.Messages |
messages |
protected io.jmix.core.MetadataTools |
metadataTools |
protected ReportRunner |
reportRunner |
protected ReportsClientProperties |
reportsClientProperties |
protected ReportsUtils |
reportsUtils |
protected ReportZipUtils |
reportZipUtils |
protected io.jmix.ui.Screens |
screens |
Constructor and Description |
---|
UiReportRunnerImpl() |
Modifier and Type | Method and Description |
---|---|
FluentUiReportRunner |
byReportCode(java.lang.String reportCode)
Creates an instance of
FluentUiReportRunner for a report with specified code. |
FluentUiReportRunner |
byReportEntity(Report report)
Creates an instance of
FluentUiReportRunner for specified report. |
protected void |
downloadZipArchive(java.util.List<com.haulmont.yarg.reporting.ReportOutputDocument> outputDocuments) |
protected ReportTemplate |
getDefaultTemplate(Report report) |
protected ReportInputParameter |
getInputParameter(UiReportRunContext uiReportRunContext,
java.lang.String multiParamAlias) |
protected Report |
getReportForPrinting(Report report) |
protected java.lang.String |
getTemplateCode(UiReportRunContext context) |
protected java.util.List<com.haulmont.yarg.reporting.ReportOutputDocument> |
multiRunSync(UiReportRunContext uiReportRunContext,
java.lang.String multiParamName,
java.util.Collection<java.lang.Object> multiParamValues) |
protected boolean |
needToShowParamsDialog(UiReportRunContext uiReportRunContext) |
protected void |
openReportParamsDialog(UiReportRunContext context,
ReportInputParameter inputParameter,
boolean bulkPrint) |
protected void |
prepareContext(UiReportRunContext context) |
void |
runAndShow(UiReportRunContext context)
Runs the report based on the information from the
UiReportRunContext and shows the result. |
protected void |
runInBackground(UiReportRunContext context,
io.jmix.ui.screen.Screen hostScreen) |
void |
runMultipleReports(UiReportRunContext context,
java.lang.String multiParamAlias,
java.util.Collection multiParamValue)
Runs a report for each object from the specified collection.
|
protected <T> void |
showDialog(io.jmix.ui.executor.BackgroundTask<java.lang.Integer,T> task) |
protected void |
showResult(com.haulmont.yarg.reporting.ReportOutputDocument document,
UiReportRunContext context) |
@Autowired protected ReportRunner reportRunner
@Autowired protected io.jmix.ui.Screens screens
@Autowired protected io.jmix.ui.download.Downloader downloader
@Autowired protected io.jmix.core.MetadataTools metadataTools
@Autowired protected io.jmix.core.Messages messages
@Autowired protected io.jmix.ui.Dialogs dialogs
@Autowired protected ReportsClientProperties reportsClientProperties
@Autowired protected ReportZipUtils reportZipUtils
@Autowired protected ReportsUtils reportsUtils
@Autowired protected org.springframework.beans.factory.ObjectProvider<FluentUiReportRunner> fluentUiReportRunners
public void runAndShow(UiReportRunContext context)
UiReportRunner
UiReportRunContext
and shows the result. The run context may be created
manually using the constructor or using the FluentUiReportRunner
.runAndShow
in interface UiReportRunner
context
- the object that contains all information required to run the report from UIpublic void runMultipleReports(UiReportRunContext context, java.lang.String multiParamAlias, java.util.Collection multiParamValue)
UiReportRunner
UiReportRunContext context = new UiReportRunContext(report) .setOutputType(ReportOutputType.PDF); uiReportRunner.runMultipleReports(context, "name", namesList);The report will be executed for each string from the "namesList" collection.
runMultipleReports
in interface UiReportRunner
context
- the object that contains all information required to run the report from UImultiParamAlias
- alias of the parameter for which a value from the collection is used for report executionmultiParamValue
- collection of valuesprotected void downloadZipArchive(java.util.List<com.haulmont.yarg.reporting.ReportOutputDocument> outputDocuments)
protected java.util.List<com.haulmont.yarg.reporting.ReportOutputDocument> multiRunSync(UiReportRunContext uiReportRunContext, java.lang.String multiParamName, java.util.Collection<java.lang.Object> multiParamValues)
public FluentUiReportRunner byReportCode(java.lang.String reportCode)
UiReportRunner
FluentUiReportRunner
for a report with specified code.
UiReportRunContext context = uiReportRunner.byReportCode("orders-report") .withTemplateCode("order-template") .withOutputNamePattern("Orders") .withParametersDialogShowMode(ParametersDialogShowMode.IF_REQUIRED) .inBackground(screen) .buildContext(); uiReportRunner.byReportCode("orders-report") .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.NO) .runAndShow(); uiReportRunner.byReportCode("orders-report") .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.YES) .runAndShow(); uiReportRunner.byReportCode("customer-orders-report") .addParam("minOrdersDate", date) .withOutputType(ReportOutputType.PDF) .withTemplateCode(""orders-template"") .runMultipleReports("customer", customersList);
byReportCode
in interface UiReportRunner
reportCode
- report codeFluentUiReportRunner
public FluentUiReportRunner byReportEntity(Report report)
UiReportRunner
FluentUiReportRunner
for specified report.
UiReportRunContext context = uiReportRunner.byReportEntity(report) .withTemplateCode("order-template") .withOutputNamePattern("Orders") .withParametersDialogShowMode(ParametersDialogShowMode.IF_REQUIRED) .inBackground(screen) .buildContext(); uiReportRunner.byReportEntity(report) .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.NO) .runAndShow(); uiReportRunner.byReportEntity(report) .withTemplate(template) .addParam("orders", ordersList) .withParametersDialogShowMode(ParametersDialogShowMode.YES) .runAndShow(); uiReportRunner.byReportEntity(report) .addParam("minOrdersDate", date) .withOutputType(ReportOutputType.PDF) .withTemplateCode(""orders-template"") .runMultipleReports("customer", customersList);
byReportEntity
in interface UiReportRunner
report
- report entityFluentUiReportRunner
protected void runInBackground(UiReportRunContext context, io.jmix.ui.screen.Screen hostScreen)
protected <T> void showDialog(io.jmix.ui.executor.BackgroundTask<java.lang.Integer,T> task)
protected void openReportParamsDialog(UiReportRunContext context, @Nullable ReportInputParameter inputParameter, boolean bulkPrint)
protected void showResult(com.haulmont.yarg.reporting.ReportOutputDocument document, UiReportRunContext context)
@Nullable protected java.lang.String getTemplateCode(UiReportRunContext context)
protected void prepareContext(UiReportRunContext context)
protected ReportTemplate getDefaultTemplate(Report report)
protected boolean needToShowParamsDialog(UiReportRunContext uiReportRunContext)
protected ReportInputParameter getInputParameter(UiReportRunContext uiReportRunContext, java.lang.String multiParamAlias)