FORMAT Section

A 4GL REPORT routine must contain a FORMAT section. The FORMAT section determines what the output from the report will look like. It works with the values that are passed to the routine through the argument list, or with global or modular variables in each record of the report. The FORMAT section begins with the FORMAT keyword, and ends with the END REPORT keywords.

4GL supports two types of FORMAT sections. The simplest (a default report) contains only the EVERY ROW keywords between the FORMAT and END REPORT keywords.

More complex FORMAT sections can contain control blocks, such as ON EVERY ROW and BEFORE GROUP OF, containing statements for execution while the report is being processed. Each control block can contain report execution statements, such as PRINT or SKIP n LINES, or other 4GL statements. Sections that follow describe the syntax of default FORMAT sections, of these seven types of control blocks, and of the report execution statements that can appear only within a control block. The FORMAT section has the following structure:

4GLREF00000012.gif

If you do not use the EVERY ROW keywords to specify a default report, you can combine one or more control blocks in any order within the FORMAT section. Except for BEFORE GROUP OF and AFTER GROUP OF control blocks, each type of control block must be unique within the report.

References

AFTER GROUP OF

BEFORE GROUP OF

EVERY ROW

FIRST PAGE HEADER

ON EVERY ROW

ON LAST ROW

PAGE HEADER

PAGE TRAILER