The Report Driver

The part of a program that generates the rows of report data (also known as input records) is called the report driver. The primary concern of the row-producing logic is the selection of rows of data.

The actions of a report driver are:

  1. Use the START REPORT statement to initialize each report to be produced. We recommend that clauses regarding page setup and report destination be included in this statement.
  2. Use a forward-only database cursor to read rows from a database, if that is the source of the report data.
  3. Whenever a row of report data is available, use OUTPUT TO REPORT to send it to the report definition.
  4. If an error is detected, use TERMINATE REPORT to stop the report process.
  5. When the last row has been sent, use FINISH REPORT to end the report.

From the standpoint of the row-producing side, these are the only statements required to create a report.