Package io.jmix.reportsui.runner
Class FluentUiReportRunner
java.lang.Object
io.jmix.reportsui.runner.FluentUiReportRunner
@Component("report_FluentUiReportRunner")
@Scope("prototype")
public class FluentUiReportRunner
extends Object
Class is used to run a report using various additional criteria:
Use the
Report
entity or report codeReportTemplate
entity or template code: if none of these fields is set, the default template is used.- Output type
- Output name pattern
- Input parameters
- Screen: screen or screen fragment from which the report runs
- Show a dialog to input the report parameters (defined by
ParametersDialogShowMode
) - Run a report synchronously or in the background (by default, a report runs synchronously)
Use the
UiReportRunner
bean to obtain an instance of the FluentUiReportRunner
.-
Field Summary
Modifier and TypeFieldDescriptionprotected org.springframework.beans.factory.ObjectProvider<FluentReportRunner>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds an input parameter to the parameter map.Creates an instance ofUiReportRunContext
based on the parameters specified for the fluent runner.inBackground
(FrameOwner originFrameOwner) Sets a property to run a report in the background.void
Builds aUiReportRunContext
instance, runs a report using this run context and shows the result.void
runMultipleReports
(String multiParamAlias, Collection multiParamValues) Builds aUiReportRunContext
instance, runs a report for each object from the specified collection.void
setUiReportRunner
(UiReportRunner uiReportRunner) withOutputNamePattern
(String outputNamePattern) Sets a name pattern of an output document.withOutputType
(ReportOutputType outputType) Sets a type of output document.Sets a mode to show a dialog to input the report parameter before report run.withParams
(Map<String, Object> params) Sets a map with input parameters.withTemplate
(ReportTemplate template) Sets a template that will be used to run a report.withTemplateCode
(String templateCode) Sets a code of template that will be used to run a report.
-
Field Details
-
fluentReportRunners
@Autowired protected org.springframework.beans.factory.ObjectProvider<FluentReportRunner> fluentReportRunners
-
-
Constructor Details
-
FluentUiReportRunner
public FluentUiReportRunner()
-
-
Method Details
-
setUiReportRunner
-
init
-
init
-
withParams
Sets a map with input parameters.- Parameters:
params
- input parameters- Returns:
- current instance of fluent runner
-
addParam
Adds an input parameter to the parameter map.- Parameters:
alias
- parameter aliasvalue
- parameter value- Returns:
- current instance of fluent runner
-
withTemplateCode
Sets a code of template that will be used to run a report.- Parameters:
templateCode
- template code- Returns:
- current instance of fluent runner
-
withTemplate
Sets a template that will be used to run a report.- Parameters:
template
- report template- Returns:
- current instance of fluent runner
-
withOutputType
Sets a type of output document.- Parameters:
outputType
- type of output document.- Returns:
- current instance of fluent runner
-
withOutputNamePattern
Sets a name pattern of an output document.- Parameters:
outputNamePattern
- name pattern of an output document- Returns:
- current instance of fluent runner
-
inBackground
Sets a property to run a report in the background.- Parameters:
originFrameOwner
- screen or screen fragment from which the report runs- Returns:
- current instance of fluent runner
-
withParametersDialogShowMode
Sets a mode to show a dialog to input the report parameter before report run. If a mode is not specified, theParametersDialogShowMode.IF_REQUIRED
is used by default.- Parameters:
mode
- mode to show a dialog to input the report parameter before report run- Returns:
- current instance of fluent runner
-
buildContext
Creates an instance ofUiReportRunContext
based on the parameters specified for the fluent runner.- Returns:
- run context
-
runAndShow
public void runAndShow()Builds aUiReportRunContext
instance, runs a report using this run context and shows the result. -
runMultipleReports
Builds aUiReportRunContext
instance, runs a report for each object from the specified collection. Objects in the collection should have the same type as an input parameter with specified alias. If the report has other parameters besides the specified one, values for these parameters are copied for each report run. As result, the ZIP archive with executed reports is downloaded.- Parameters:
multiParamAlias
- alias of the parameter for which a value from the collection is used for report executionmultiParamValues
- collection of values
-