Package io.jmix.reports.runner
Class FluentReportRunner
java.lang.Object
io.jmix.reports.runner.FluentReportRunner
@Component("report_FluentReportRunner")
@Scope("prototype")
public class FluentReportRunner
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
Use the
ReportRunner
bean to obtain an instance of the FluentReportRunner
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds an input parameter to the parameter map.Creates an instance ofReportRunContext
based on the parameters specified for the runner.run()
Builds aReportRunContext
instance and runs a report using this run context.void
setReportRunner
(ReportRunner reportRunner) withOutputNamePattern
(String outputNamePattern) Sets a name pattern of an output document.withOutputType
(ReportOutputType outputType) Sets a type of output document.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.
-
Constructor Details
-
FluentReportRunner
-
FluentReportRunner
-
-
Method Details
-
setReportRunner
-
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
-
buildContext
Creates an instance ofReportRunContext
based on the parameters specified for the runner.- Returns:
- run context
-
run
Builds aReportRunContext
instance and runs a report using this run context.- Returns:
- report execution result
-