Compaq COBOL AAQ2G1FTK User Manual

Page 325

Advertising
background image

Producing Printed Reports

10.8 Programming a Report Writer Report

Detailed examples using Report Writer are documented in Section 10.9.

10.8.1 Using the REPORT Clause in the File Section

To create a report with Report Writer, you must write a report to a specific
file. That file is described by a File Description (FD) entry; however, unlike a
conventional or linage-file report, your FD entry for a Report Writer file must
contain the REPORT clause, and you must assign a name for each report in the
REPORT clause.

For instance, in the following example, the File Description on the left does not
specify Report Writer; however, the example on the right correctly shows a Report
Writer File Section entry:

FD

SALES-REPORT

FD

SALES-REPORT

.

.

.

.

.

.

01

SALES-AREA

PIC X(133).

01

PRINT-AREA

PIC X(133).

REPORT IS MASTER-LIST.

To completely describe the report that you specify in the REPORT clause, you
must define a Report Section in the Data Division. Section 10.8.2 describes the
Report Section.

10.8.2 Defining the Report Section and the Report File

The Report Section in the Data Division provides specific information about the
reports that are specified with the REPORT clause. Each report named in the
Data Division File Section also must be defined in the Report Section.

To define a report, use a Report Description (RD) entry followed by one or more
Report Group Description entries (01-level) in the Report Section. For example:

FILE SECTION.

FD

SALES-REPORT
REPORT IS MASTER-LIST.
.
.
.

REPORT SECTION.

RD

MASTER-LIST
PAGE LIMIT IS

66

HEADING

1

FIRST DETAIL

13

LAST DETAIL

30

FOOTING

50.

The RD supplies information about the format of the printed page and the
organization of the subdivisions (see Section 10.8.4).

10.8.3 Defining a Report Writer Logical Page with the PAGE Clause

To define the logical page for a Report Writer report, you use the PAGE clause.
This clause enables you to specify the number of lines on a page and the format
of that page. For example, the PAGE clause allows you to specify where the
heading, detail, and footing appear on the printed page. If you want to use
vertical formatting, you must use the PAGE clause.

Producing Printed Reports 10–25

Advertising