上QQ阅读APP看书,第一时间看更新
How it works...
The OnAfterSubstituteReport event is fired between when a report is requested to execute and the actual execution. This gives us the chance to intercept that call and replace the report that will be executed.
Don't worry, this event is fired when a user clicks on a report action on a page, or when any of the following commands are executed in the system, which means it will work great for replacing processing reports as well as printed ones:
- Run
- RunModal
- SaveAsHtml
- SaveAsXml
- SaveAsPdf
- SaveAsExcel
- SaveAsWord
- RunRequestPage
- Execute
- SaveAs
When the subscriber is executed, if the incoming ReportId and NewReportId parameters do not match, and NewReportId is not -1, then this means that the report has already been substituted by another subscriber (for example, another Business Central application) and you'll need to determine how to handle that.