How triggers work

Triggers are defined in the Structure view of the report design document and in the BDL code. For a Genero BDL program, the SQL statement defines the sort criteria.

Each row streamed to the report contains all the data or text specified by the data schema (the data report file). The data schema feeds this information to the report structure.

Triggers and Genero BDL report applications

Trigger nodes are specified by the ORDER EXTERNAL BY 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. A trigger node displays in the Report Structure as a filled red circle if it has one or more report elements as immediate children; otherwise, it displays as an empty circle.

Figure: The ORDER BY clause and report triggers

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

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 attempts 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.