Report Formats

A report has one or more report formats. A report format is a structured group of fields and text that you want the report to print as a unit.

For example, if a report has a standard header, the standard header is a report format; the report prints all fields and text in the standard header as a unit.

Except for the standard header and footer, you define report formats based on the key fields of the report access order. Each key field can have its own report format, or consecutive key fields can have the same report format.

You define a report format by assigning a letter (Level) to each key field in the access order. Assigned letters must be in consecutive order (A, B, C, and so on). You can have two consecutive key fields at the same level (for example, A, A, B).

After you define the report structure, the Report Format form appears. Each report format has a separate window on the Report Format form.

Within a report format, you can paint fields only at or above that format level. You can also paint fields from files with a one-to-one relation with fields in that format.

At the Job Code level in the previous example, you can paint only the Company field, the Job Code field, and fields from files with a one-to-one relation, using the Company or Job Code fields. For example, because the Company file uses only Company as a key field, you can paint all fields in the Company file at both the A and B levels.

Detail Formats

When you use a detail file in a report, you define and paint the detail file format separately from the primary file format. You must define and paint the primary file format before you can define and paint the detail file format.

When you define a detail file structure, the Structure Definition window displays the primary file structure but does not let you change it. Similarly, when you paint a detail format, the Report Format form displays the primary file format but does not let you change it.

For example, you define a report that lists employees and their dependents. Employee is the primary file and Dependents is the detail file (that is, the Dependents file has a one-to-many relation from the Employee file). The access order for the Employee file is Company and Employee (number).

The access order for the Dependents file is Company, Employee, and Dependent. The key field Dependent is not part of the primary file. You must assign it a level that follows consecutively from the last primary level.

Page Breaks

When the value of a field in the access order changes, you can force the report to start printing on a new page. When the value of the field marked with a Page Break changes, or when the value of a field on the level or levels above the Page Break changes, the report starts printing a new page.

Shared Formats

If a report has multiple access orders, you can share a report format defined for one access order with another access order if their key fields (fields used in the access order) are the same. If the key fields are different, you must define new report formats for the additional access orders.

Summaries and Optional Summaries

You can define a summary or an optional summary for a report format level. If you define a summary, that format level has only a summary format. If you define an optional summary, that format level has both a summary format and a report (nonsummary) format.

When you run a report with an optional summary, you must specify whether to print the summary or the nonsummary format. Therefore, after you define an optional summary, you must paint a summary parameter field on the parameter form of the report. When you run the report, the value you type in the summary parameter field tells the program whether to process the summary format or the nonsummary format.

A summary report prints total (summarized) information without printing the detail that built the total. Summary formats are the lowest level format; once a summary is defined, nothing can be defined beneath it.

Summaries are identified on the report structure. To summarize a particular level, that field must be included in the report structure. Choosing a summary for a level deletes all lower report and total formats because they are no longer necessary for a summary report.

An optional summary report must have a parameter field defined on the parameter form. This field lets you type in a value that runs the report in either Detail or Summary mode. Choosing an optional summary for a level does not delete other formats. Defining an optional summary creates a summary format at the selected level. This format should be painted as the lowest level format with a blank line above the heading, a heading line, and a data line.

On the Report Format form, SumFmt identifies a summary format window.