Report triggers:
It enables execution of PL/SQL functions at specific times in during the execution and formatting of a report. For Customization of formats, initialization tasks and accessing database many more should be done using the conditional processing capabilities of PL/SQL in these triggers.
Oracle reports should have five global report triggers. The trigger names denote at what point the trigger fires:
1. Before parameter form fires before the runtime parameter form is displayed. From this trigger, the values of parameters, the PL/SQL global variables and report-level columns can be accessed and manipulated if needed.
2. After parameter form fires after the runtime parameter form is displayed. From this trigger, parameter values can be accessed and their values can be validated. This trigger can be used to modify parameter values or, return to the runtime parameter form if an error occurs.
3. Before report fires before the report is executed but after queries are parsed and data is fetched.
4. Among pages fires before every page of the report is formatted, it except the extremely first page. This trigger could be used for customized page formatting.
5. After report fires after the report previewer is exited or after report output is sent to a specified destination, like as a file or a printer. That trigger can be used to clean up any initial processing which was done. For instance if temporary tables are created during report execution, like tables can be deleted in the After report trigger.
Which trigger to use?
As a common rule, any processing which will effect the data retrieved through the report should be performed in the before parameter form or after parameter form triggers. These are the two report triggers in which fire before any SQL statement is pared or data is fetched.
Any processing which will not effect the data retrieved through the report can be performed in the other triggers.