Using Events to Populate a Report with Data

Once you are satisfied with the design and layout of your report, your next step is to populate the report with data and possibly manipulate the output in some fashion. This is accomplished by writing code for events that perform these types of functions. These events are associated with the report itself and its elements, and are accessed from the Events tab. There are three types of events:

Before and After Print events: These type of paragraphs are tied specifically to individual elements of your report and the report itself. They allow you to code instructions for what you want to do before and after each report is generated.

BeforeDoPrint and AfterDoPrint events: These events are only associated with the report itself. They provide the code for performing READs and READ NEXTs, and initializing and resetting print loops. These paragraphs are what populates the report with data. Using these events from the Report Writer makes them part of the .psf file, which provides several advantages. These advantages, as well as coding samples are described in BeforeDoPrint and AfterDoPrint Event Paragraphs.

LoadGridInit and LoadGridNext Print events: These Grid control events provide the code for performing READs and READ NEXTs, and initializing and resetting print loops for grid controls. These paragraphs are what populates the grid with data. Using these events from the Report Writer makes them part of the .psf file, which provides several advantages. These advantages, as well as coding samples are described in LoadGridInit and LoadGridNext Event Paragraphs.

Note: The BeforeDOPrint, AfterDoPrint, LoadGridInit and LoadGridNext events are new features of version 8.1 that provide a better way of coding reports. However, reports created with older versions of AcuBench are supported and can be regenerated without making any changes to your code. See Existing Reports Imported from Earlier Versions of AcuBench for details.

The following sections describe the process of adding and coding these types of events.