Hey there. Working with reports in NAV can be a challenge especially when you are new to it. I came across serious trouble working with Report triggers. I needed to execute some code before report processing start. But the triggers were confusing. So i went around looking for a solution. First let me give you a shot of the flow.
- OnItReport
The function is executed once a user selects to run a report. The function initializes processing. Put here any code you wanna execute before you begin processing any records on the report. After Initializing, the system moves forward and executes a request page if it is defined for the report. The user can then set any filters before running a report.
- OnPreReport
At this point, no records have been retrieved but initializing the report has already been done. You may as well add some code here to be processed before any records are retrieved. Once the system finishes executing whatever is defined here, it will begin executing OnPreDataItem trigger for the first record.
- OnPreDataItem
Its run just before it retrieves the first record.
- OnPostDataItem
It is run immediately after retrieving the last record.
- OnPostReport
This trigger is executed once all the records have been retrieved.
Now we know the sequence of those triggers. You may check out details from here
Please Let me know if the above information was useful and what you would like me to discuss in the next post. Thank you
ReplyDelete