- Print
- PDF
Complicated Scenarios
For scenarios when report replacement is more complicated, and a data structure does not match the original report, there is an option to use a custom class for a replacement report.
For more information about creating and using custom class, see the LACCustomClass_WhitePaper document.
There are several methods related to replacement reports in the report custom class:
public void replacementRun(LACReportReplacementBase replacementBase)
This method is used to execute a replacement report. Write Execution of report by specifying necessary ranges and printout parameters from the original report. By default, the runReplacementPreProcessed method is used to execute a replacement report. If your custom runReplacement method supports only one report execution, overwrite fixedReplacementReportName.
The _replacementBase_parameter is LACReportReplacementBase class holding information about the original and replacement reports.
You can overwrite this method if you want to have a custom execution code for the replacement report.
By default, this method calls the replacementRunPreProcessed method for a pre-processed report execution.
protected void replacementRunPreProcessed(LACReportReplacementBase replacementBase)
Starts an execution of the replacement report. This method starts only pre-processed reports. By default, this method is called from the replacementRun() method. The method gets pre-processed details record and adds ranges for CreatedTransactionId in the replacement report query. It also passes through all print destination settings and collects execution info after the report execution.
The replacementBase parameter is LACReportReplacementBase class holding information about the original and replacement reports.
public LACReportName replacementReportNameFixed()
This method must return the report name if the runReplacement method is designed to execute only one report. If specified, only this report is available in the replacement report name lookup.
public boolean replacementPreRun()
This method is used to control the execution of the original report's preRun method. If Pre-processed handing is used on the replacement report, it means that the ex: SalesInvoiceTmp table has to be built prior to the Query-based replacement report execution. In such case, this method shall return true.
If a query-based report does not use any TMP tables created in the preRun method, false is returned to enhance the performance and skip unnecessary steps.