@Component(value="report_FluentUiReportRunner")
@Scope(value="prototype")
public class FluentUiReportRunner
extends java.lang.Object
Report
entity or report codeReportTemplate
entity or template code: if none of these fields is set, the default template is used.ParametersDialogShowMode
)UiReportRunner
bean to obtain an instance of the FluentUiReportRunner
.Modifier and Type | Field and Description |
---|---|
protected org.springframework.beans.factory.ObjectProvider<FluentReportRunner> |
fluentReportRunners |
Constructor and Description |
---|
FluentUiReportRunner() |
Modifier and Type | Method and Description |
---|---|
FluentUiReportRunner |
addParam(java.lang.String alias,
java.lang.Object value)
Adds an input parameter to the parameter map.
|
UiReportRunContext |
buildContext()
Creates an instance of
UiReportRunContext based on the parameters specified for the fluent runner. |
FluentUiReportRunner |
inBackground(io.jmix.ui.screen.FrameOwner originFrameOwner)
Sets a property to run a report in the background.
|
FluentUiReportRunner |
init(Report report) |
FluentUiReportRunner |
init(java.lang.String reportCode) |
void |
runAndShow()
Builds a
UiReportRunContext instance, runs a report using this run context and shows the result. |
void |
runMultipleReports(java.lang.String multiParamAlias,
java.util.Collection multiParamValues)
Builds a
UiReportRunContext instance, runs a report for each object from the specified collection. |
void |
setUiReportRunner(UiReportRunner uiReportRunner) |
FluentUiReportRunner |
withOutputNamePattern(java.lang.String outputNamePattern)
Sets a name pattern of an output document.
|
FluentUiReportRunner |
withOutputType(ReportOutputType outputType)
Sets a type of output document.
|
FluentUiReportRunner |
withParametersDialogShowMode(ParametersDialogShowMode mode)
Sets a mode to show a dialog to input the report parameter before report run.
|
FluentUiReportRunner |
withParams(java.util.Map<java.lang.String,java.lang.Object> params)
Sets a map with input parameters.
|
FluentUiReportRunner |
withTemplate(ReportTemplate template)
Sets a template that will be used to run a report.
|
FluentUiReportRunner |
withTemplateCode(java.lang.String templateCode)
Sets a code of template that will be used to run a report.
|
@Autowired protected org.springframework.beans.factory.ObjectProvider<FluentReportRunner> fluentReportRunners
@Autowired public void setUiReportRunner(UiReportRunner uiReportRunner)
public FluentUiReportRunner init(Report report)
public FluentUiReportRunner init(java.lang.String reportCode)
public FluentUiReportRunner withParams(java.util.Map<java.lang.String,java.lang.Object> params)
params
- input parameterspublic FluentUiReportRunner addParam(java.lang.String alias, java.lang.Object value)
alias
- parameter aliasvalue
- parameter valuepublic FluentUiReportRunner withTemplateCode(java.lang.String templateCode)
templateCode
- template codepublic FluentUiReportRunner withTemplate(ReportTemplate template)
template
- report templatepublic FluentUiReportRunner withOutputType(ReportOutputType outputType)
outputType
- type of output document.public FluentUiReportRunner withOutputNamePattern(@Nullable java.lang.String outputNamePattern)
outputNamePattern
- name pattern of an output documentpublic FluentUiReportRunner inBackground(io.jmix.ui.screen.FrameOwner originFrameOwner)
originFrameOwner
- screen or screen fragment from which the report runspublic FluentUiReportRunner withParametersDialogShowMode(ParametersDialogShowMode mode)
ParametersDialogShowMode.IF_REQUIRED
is used by default.mode
- mode to show a dialog to input the report parameter before report runpublic UiReportRunContext buildContext()
UiReportRunContext
based on the parameters specified for the fluent runner.public void runAndShow()
UiReportRunContext
instance, runs a report using this run context and shows the result.public void runMultipleReports(java.lang.String multiParamAlias, java.util.Collection multiParamValues)
UiReportRunContext
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.multiParamAlias
- alias of the parameter for which a value from the collection is used for report executionmultiParamValues
- collection of values