Producing Printed Reports
10.8 Programming a Report Writer Report
The following example indicates that the phrase BEGINNING-OF-REPORT
is to be displayed just before the REPORT HEADING group named REPORT-
HEADER; the phrase END-OF-REPORT is to be displayed just before the
REPORT FOOTING group called REPORT-FOOTER.
PROCEDURE DIVISION.
DECLARATIVES.
BOR SECTION.
USE BEFORE REPORTING REPORT-HEADER.
BOR-A.
DISPLAY "BEGINNING-OF-REPORT".
EOR SECTION.
USE BEFORE REPORTING REPORT-FOOTER.
EOR-A.
DISPLAY "END-OF-REPORT".
END DECLARATIVES.
Note that you cannot use INITIATE, GENERATE, or TERMINATE in a
Declarative procedure.
10.8.13.6 Suppressing a Report Group
You can also use the SUPPRESS statement in a USE BEFORE REPORTING
procedure to suppress the printing of a report group. For example, you can
suppress printing of an unnecessary total line, such as a line for a monthly sales
total that has only one sale or a line of zeros.
The SUPPRESS statement nullifies any NEXT GROUP and LINE clauses, but
leaves the LINE-COUNTER value unchanged.
Note that the SUPPRESS statement applies only to that particular instance of
the report group; that group will be printed the next time unless the SUPPRESS
statement is executed again.
The SUPPRESS statement has no effect on sum counters.
10.8.14 Selecting a Report Writer Report Type
You can print two types of reports using the Report Writer feature. In a detail
report, you print primary data information as well as totals. In a summary
report, you print only control heading and footing information (such as report
data headings and totals) and exclude detail input record information.
Section 10.9 provides examples of detail and summary reports.
10.8.14.1 Detail Reporting
In detail reporting, at least one printable TYPE DETAIL report group must be
specified. A GENERATE statement produces the specified TYPE DETAIL report
group and performs all the automatic operations of the Report Writer facility as
specified in the report group entries (see Section 10.8.13.3).
In the following example, DETAIL-LINE is the name of the DETAIL report group.
When this GENERATE statement executes, a detail report is printed.
200-READ-MASTER.
READ CUSTOMER-FILE AT END MOVE HIGH-VALUES TO NAME.
IF NAME NOT = HIGH-VALUES GENERATE DETAIL-LINE.
10–42 Producing Printed Reports
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......