Every report, report section, and report control can be assigned a Before Print and After Print paragraph. These events are
used to perform initialization tasks before report generation and next or additional tasks after report generation.
Examples include:
- Open a relational database.
- Perform a calculation just before printing a total in an entry field.
- Move a numeric value from a COMP data type to a DISPLAY type (to show a monetary amount, for example).
- Update the color variable associated with an entry field (to show negative values in red, for example, in an expense tracking
report).
- Update the page number in a page header or footer.
- Ask the user to confirm that report generation should start.
An After Print paragraph is your last chance to intervene before leaving the just-printed report element and moving on to
the next one. You might use an After Print paragraph to:
- Add the data that’s just been printed in a field to a running tally.
- Save a piece of data into Working-Storage before moving on to print the next item.
- Initialize a data item that has just been printed.