Triggers

The data for your report is passed from your report program to the report one row at a time, sorted by the criteria specified in your report.

Each row streamed to the report contains all the data or text specified by the data schema (the data report file). You may want to print some of the data from each row received; this is generally the report body. Other data and text should only print when a change in a specific data item takes place; for example, you may want to print a total each time the customer_id value changes. The triggers in the structure of the report specify what should be printed when a change in data occurs. Arrange all the report elements for a single trigger in a parent container.

Triggers and Genero BDL report applications

Trigger nodes are specified by the ORDER EXTERNAL statement in the REPORT program block in your Genero BDL code, and indicate the data values by which the data is grouped. The final trigger node is ON EVERY ROW, specifying what is to be printed for each row of data passed to the report. The trigger nodes display in the Report Structure as red bullets:


This figure is a diagram mapping each field from the ORDER EXTERNAL BY clause to a trigger in the Report Structure.

Figure 1. The ORDER BY clause and report triggers

When the Data Schema changes

When the data schema associated with a report is modified, the Genero Report Designer regenerates the triggers to match the new schema. The Genero Report Designer will attempt to update the Report Structure using the minimum number of modifications required to perform the update. Cases of adding new triggers and cases of removing triggers that do not contain document fragments are handled automatically.

When it is necessary to move or remove a trigger that contains a document fragment, a warning displays in the Document Errors view stating that the fragment may require manual correction. These warnings are stored persistently in the report definition (4rp) file. The warning can only be removed by using the context menu Clear trigger update message (issue is fixed).

The warning message Data schema changed. The document has been updated to match the changes is only displayed when a new trigger is inserted, a trigger is removed or a trigger is moved.