- Print
- PDF
Complicated Scenarios
When report replacement gets more complicated and the data structure does not match the original report, an option is available to use a custom class for a Replacement report.
For more information about creating and using a custom class, see the LACCustomClass_WhitePaper document.
The following four methods can be used with 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 the 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)
This method starts the execution of the Replacement report. It starts only pre-processed reports. By default, this method is called from the replacementRun() method. The method gets the 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 a 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.