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
Reportentity or report codeReportTemplateentity 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds an input parameter to the parameter map.Creates an instance ofReportRunContextbased on the parameters specified for the runner.com.haulmont.yarg.reporting.ReportOutputDocumentrun()Builds aReportRunContextinstance and runs a report using this run context.voidsetReportRunner(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 ofReportRunContextbased on the parameters specified for the runner.- Returns:
- run context
-
run
public com.haulmont.yarg.reporting.ReportOutputDocument run()Builds aReportRunContextinstance and runs a report using this run context.- Returns:
- report execution result
-