- Overview
- "Opening" event of the report
- Execution of the event
- Password of the data file used as source for the report
- Initializing variables
- Usage example
- Event "Reading data"
- Execution of the event
- Reports based on a text file
- Usage example
- Event "Filtering (taking the record into account?)"
- Execution of the event
- Using the Filter event
- Usage example
- "Closing" event of the report
- Execution of the event
- Usage example
- Event "Before printing the report again"
- Execution of the event
- Usage example
Events associated with reports
The following events are associated to reports (order of appearance in the code editor): Several events are associated with the reports. These events are run when printing the report. "Opening" event of the report Execution of the event The "Opening" event of the report is run when starting the report print. Reminder: When starting a report (including during a test), the events are run in the following order: Password of the data file used as source for the report If the source data file of the report is password protected, you must enter the password before opening the data file (with HPass, for example.) If the data file was not opened before printing the report, the password can be specified in the "Opening" event of the report. Usage example This event is used to: - declare the global variables of the report.
- change the report bounds with the MinValue and MaxValue properties.
- initialize the passwords of data files if necessary.
- configure the destination of the print (iDestination).
- pass parameters to the query linked to the report (iInitReportQuery).
- retrieve the parameters passed to the report.
- change the report data source.
Remark: iPrint must not be used in the report "Opening" event. Execution of the event This event is run when browsing the records to print (in the print loop), once the record has been read. Reports based on a text file For reports based on a text file (with programmed reading), the event "Reading data" is used to read the records in the text file in order to print them. Usage example This event is used to: - perform block substitutions (as the next record to print is known).
- select records.
- perform specific calculations.
Remark: This event returns True if there are still records to print and False if there are no more records to print. If you do not want to print a record, use the event "Filtering (taking the record into account?)". Event "Filtering (taking the record into account?)" Execution of the event This event is run: - when the data source is initialized (reports based on a data file, view or memory area).
- in the print loop, once the record is read (reports based on a query or on a Table control).
This event filters the records displayed in the report. Using the Filter event If there are lines of code in this event, they must return a value: - Cancel to stop reading the records (and to stop the print).
- True to specify that the record matches the filter and that it must be printed.
- False to specify that the record does not match the filter and that it must not be printed.
Usage example This event is used to: - select records.
- perform advanced calculations (subtotal, ...) for the reports based on data files, views or memory zones.
"Closing" event of the report Execution of the event This event is run once the report has been printed, just before closing the report. Remark: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...). Usage example This event is used to:
This page is also available for…
|
|
|
|