The examples in the Pascal script documentation can be easily understood in the report designer. Only the Report.BeforePrint event is used to trace the examples. The evaluation is performed using the ShowMessage output function, which is displayed directly from the preview.
To understand the examples, you should set up a test report that has only one detail area and is not assigned to a data source. Otherwise, the output box would be displayed as often as data records exist.
How to create a test environment
- Select the Report Designer from the main menu bar under System Administration.
- In report management, copy a label from the address area using the File menu.
- Select Properties of the copied form and change the title and internal name to TEST by clicking Apply.
- Open the report by choosing Edit Report.
- Remove all elements in the report using the menu items Edit, Select all and Delete.
- Set the data source under Report, Data to
- Save the report template as File
- Change the display to Calculations
- Switch to the Events option under View
- The sample scripts use the event BeforePrint directly on REPORT, select the event with the right mouse button and confirm with New.
- Remove the procedure body Begin End
- Insert the example from the Pascal script description completely.
- Since the test is usually output via the ShowMessage dialog - and not as an expression - you only need to switch to the preview to be able to check the result.