Report extension object: a basic example
Making small modifications to an existing report is a very common task. Together with creating new pages and codeunits, this is probably one of the most repetitive and frequent jobs for a developer.Let's say that we would like to make the following changes to the standard sales order report:
- Show the Customer Category field in the sales order header.
- Print GIFT label in the sales lines for item lines with 100% discount.
The very first question that a developer has to pose is: would this be suitable to be done through a ReportExtension
object? As we have learned previously, a report extension object should be used every time possible to delegate maintenance of the core business logic to the author of the source (target or extended) report. In this case, we just need to:
- Add columns to an existing dataset.
- find out the appropriate event publishers in the sales order report.
- subscribe to these publishers as needed.
- create a copy of the layout...