Producing Printed Reports
10.10 Solving Report Problems
Table 10–2 (Cont.) Results of Group Indicating
Without Group Indicating
With Group Indicating
STATE
CITY
STORE
NUMBER
STATE
CITY
STORE
NUMBER
Massachusetts
Maynard
111111
Massachusetts
Maynard
111111
Massachusetts
Maynard
222222
222222
Massachusetts
Maynard
333333
333333
Massachusetts
Maynard
444444
444444
Massachusetts
Tewksbury
111111
Massachusetts
Tewksbury
111111
Massachusetts
Tewksbury
222222
222222
New Hampshire
Manchester
111111
New Hampshire
Manchester
111111
New Hampshire
Manchester
222222
222222
New Hampshire
Merrimack
333333
New Hampshire
Merrimack
333333
New Hampshire
Merrimack
444444
444444
New Hampshire
Merrimack
555555
555555
New Hampshire
Nashua
666666
New Hampshire
Nashua
666666
10.10.3 Fitting Reports on the Page
If you need more columns than physically can fit on a page, you can do the
following:
•
Eliminate as many unused spaces as possible between columns. Columns
should not be run together; however, you can use one blank space instead of
several.
•
Eliminate nonessential information.
•
Print two or more lines with staggered headers and columns.
•
Print two reports.
10.10.4 Printing Totals Before Detail Lines
A report that must include totals at the top of the page before the detail lines has
three solutions as follows:
•
Store the logical print lines in a table, total the table, and then print from the
table.
•
Pass through the file twice. The first time, compute the totals. The second
time, print the report. This method is slow and complicated if there are many
subtotals.
•
Write the lines into a file with a sort key containing the report, page, and
line number. When your program writes the last line and computes the total,
have it assign a page and line number to the total line’s sort key. Use an
appropriate page and line number to cause the total line to sort in front of its
detail lines. After the program completes, sort the file, read it, drop the sort
key, and produce the report.
10–88 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: ......