Docentric Basic Report Execution Hooks Overview

The needed artifacts for each Basic report are:

  • Data Source Provider (DSP) class which provides the report data; it also enables changing the report execution settings (e.g. Selected Template, Selected Print Destination, etc.) and Print Destination Placeholders handling dynamically, i.e. during report execution.
  • Print Report Manager (PRM) class which defines Report ID and the report parameters, handles report execution from building and opening the report dialog form to printing the report to a selected print destination.
  • Report Menu Item which points to the report Print Report Manager (PRM) class. When opens the main() method of the PRM class is invoked. This will result in opening the report dialog form and afterwards printing the report.
The wizard generates most methods that can be overridden along with basic APIs and examples of use.

A sample Data Source Provider (DSP) class generated by the wizard:

A sample Print Report Manager (PRM) class generated by the wizard:

Data Source Provider (DSP) class

In a Data Source Provider (DSP) class we can override the following methods:

  • generateXmlDataSource()
    Use Record Builder to build the report data source by simply traversing through the data needed for the report and adding them to Record Builder as (calculated) records, (calculated) fields, field groups, display (parameterless) methods, etc. Example of use:

    Learn about writing DSP classes in detail >>

  • overrideReportRunSettings()
    Dynamically changes the report execution settings such as the report output file name, e-mail subject, e-mail body, To email addresses, etc. or replace standard and custom placeholders.

    Learn more about changing the report execution settings >>
    Learn more about Print Destination Standard and Custom Placeholders >>

  • preRunGenerateDS()
    Override this method in order to calculate some data that will be used in the this.generateXmlDataSource() and this.overrideReportRunSettings() methods, or to modify parameters for data source generation and report/document execution that are stored in the this.parmParams(), this.parmParamsMailMerge(), and this.parmParamsReporting() methods. This way you can change, e.g. run-time language: this.parmParams().parmDsLanguageId() that affects label translations, data formats, selection of the report template, etc.

  • postRunGenerateDS()
    Override this method in order to perform some post run actions after the document/report data source is generated, i.e. the this.generateXmlDataSource() method is executed.
    The this.overrideReportRunSettings() method will be executed next in report execution pipeline.

For Print Report Manager (PRM) class we can override the following methods:

  • main()
    You can change the default implementation (below) of the main()method as needed.

  • defineReportId()
    Defines Report ID. Example of use:

  • addParameters()
    Defines and initializes the report parameters. Example of use:

  • validateReportParameters()
    Validates the report parameters before the report runs. If the report parameters are not valid, the report will not be executed. Example of use:

  • buildParameterFormControls()
    Changes the default rendering of the report parameters on the report dialog form - rendering order, layout, form control properties, etc. Example of use:

  • modifyParameterFormBuildControls()
    Modifies form controls on the report dialog form bound to the report parameters. Use this method if the form controls' methods such as lookup() or modified() have to be overridden. Example of use:

  • modifyPrintSettings_PrePrompt()
    Modifies the report execution settings before the report prompts, i.e. before the report dialog form is shown. Use this method if the default values of settings and parameters depend on values saved with the LastValue framework. Otherwise, the default values of the report parameters should be set in the addParameters() method. Example of use:

  • modifyPrintSettings_PreRun()
    Modifies the report execution settings before the report runs. Use this method if you want to use the display string value of a report parameter instead of its value (e.g. the vendor name instead of VendAccount), to change the selected print destination or template, to set the report parameter value, etc. Example of use:

  • printReportCompleted()
    Implement if a specific action is needed when printing the report is completed.

  • printReportCanceled()
    Implement if a specific action is needed when printing the report is canceled.

We can also override the collectParameterValues(), printReportFormRun_PostInit(), printReportFormRun_PostRun(), setControlValuesForReportParameters(), etc. methods. Descriptions and the purpose of the methods can be found in the code.

See also

Basic Report Examples >>
How to Run a Docentric Basic Report from Code >>
How to Run a Report in the Context of an Underlying Entity >>
How to Create a Complex Report Dialog Form >>