Triggers

The data for your report is passed from your Genero BDL report program to the report one row at a time, sorted by the criteria in your BDL program's SQL statement. You may want to print some of the data or additional text for every row that is passed to the report; this is generally the report body. Some data or text should print when a change in a specific data item takes place (totals that print every time the customer_id changes, for example.) 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.

Trigger nodes are specified by the ORDER EXTERNAL statement in the REPORT program block in your 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 (rdd) assoicated 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.