onPrint Handler
The onPrint handler is executed before a report is printed or exported. The typical usages of onPrint handlers are as follows:
Note: The best way to do this is to set 'Hide on Print and Export'. See Property Dialog Boxes in the Report Designer for details.
• Hiding non-printable elements.
• Including a title page in a report
• Performing logic specific to printing and exporting.
The onPrint event handler offers a special property, 'report.format', through the 'docInfo' object.
docInfo['report.format']
When the user exports a report to a specific format, this property holds the file extension of the specified format (e.g., xls, html, rtf, txt, etc.) This allows you to implement different logic based on the selected export format.