|
- Overview
- "Opening" event of the report
- Execution of the event
- Password of the data file used as source for the report
- Initializing variables
- Use examples
- Event "Reading data"
- Execution of the event
- Reports based on a text file
- Use examples
- Event "Filtering (taking the record into account?)"
- Execution of the event
- Using the Filter event
- Use examples
- "Closing" event of the report
- Execution of the event
- Use examples
- Event "Before printing the report again"
- Execution of the event
- Use examples
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 data file used as source for the report is password protected, this password must be specified before opening the data file (by 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. Use examples This event is used to: - declare the global variables of the report.
- modify the report bounds with ..MinValue and ..MaxValue.
- initialize the passwords of data files if necessary.
- configure the destination of the print (iPreview).
- pass parameters to the query linked to the report (iInitReportQuery).
- retrieve the parameters passed to the report.
- change the data source of the report.
Note: 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. Use examples This event is used to: - perform block substitutions (as the next record to print is known).
- select records.
- perform specific calculations.
Note: This code returns True if there are still records to print and False if there is no record 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, a view or a memory zone).
- 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.
Use examples This event is used to: - select records.
- perform advanced calculations (sub-total, ...) for the reports based on 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. Versions 21 and laterNote: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...). New in version 21Note: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...). Note: iCurrentFile is used to find out the name of the file generated for the report (for the exports in PDF, HTML, ...). Versions 21 and later New in version 21
This page is also available for…
|
|
|
| |
| Click [Add] to post a comment |
|
| |
|
| |
| |
| |
| |
| |
| |
| | |
| |