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:
  • Report entity or report code
  • ReportTemplate 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 Details

    • FluentReportRunner

      public FluentReportRunner(Report report)
    • FluentReportRunner

      public FluentReportRunner(String reportCode)
  • Method Details

    • setReportRunner

      @Autowired public void setReportRunner(ReportRunner reportRunner)
    • withParams

      public FluentReportRunner withParams(Map<String,Object> params)
      Sets a map with input parameters.
      Parameters:
      params - input parameters
      Returns:
      current instance of fluent runner
    • addParam

      public FluentReportRunner addParam(String alias, Object value)
      Adds an input parameter to the parameter map.
      Parameters:
      alias - parameter alias
      value - parameter value
      Returns:
      current instance of fluent runner
    • withTemplateCode

      public FluentReportRunner withTemplateCode(@Nullable String templateCode)
      Sets a code of template that will be used to run a report.
      Parameters:
      templateCode - template code
      Returns:
      current instance of fluent runner
    • withTemplate

      public FluentReportRunner withTemplate(@Nullable ReportTemplate template)
      Sets a template that will be used to run a report.
      Parameters:
      template - report template
      Returns:
      current instance of fluent runner
    • withOutputType

      public FluentReportRunner withOutputType(ReportOutputType outputType)
      Sets a type of output document.
      Parameters:
      outputType - type of output document.
      Returns:
      current instance of fluent runner
    • withOutputNamePattern

      public FluentReportRunner withOutputNamePattern(@Nullable String outputNamePattern)
      Sets a name pattern of an output document.
      Parameters:
      outputNamePattern - name pattern of an output document
      Returns:
      current instance of fluent runner
    • buildContext

      public ReportRunContext buildContext()
      Creates an instance of ReportRunContext based on the parameters specified for the runner.
      Returns:
      run context
    • run

      public ReportOutputDocument run()
      Builds a ReportRunContext instance and runs a report using this run context.
      Returns:
      report execution result