PRTFIL and PRTOBJ

595 Views


There are two different types of report functions: Print File(PRTFIL) and Print Object(PRTOBJ).

The PRTFIL function is an external function type which specifies a complete report in itself, while PRTOBJ is an internal function type, which specifies a segment of a report for inclusion within another report function.

Page headings and footers are always defined by the PRTFIL function.

PRTFIL

Each PRTFIL function specifies the layout and processing you will use when printing records from an access path. It specifies the indentation of any embedded PRTOBJ functions within the overall report design.

It specifies all global properties of the report such as page size and page headings.

· A print file function must be based on a Retrieval(RTV), Resequence(RSQ), or Query(QRY) access path.

· Calls to embedded PRTOBJ functions will be inserted at the appropriate points in the action diagram of the embedding function.

· Each PRTFIL function has its own default report design which can be edited. Embedded PRTOBJ report designs are shown as part of the PRTFIL report design but are protected and cannot be edited directly.

Only the indentation (distance of embedded design from the left-hand margin of the report) can be changed.

A PRTFIL function and its embedded PRTOBJ functions are implemented as a single OS/400 printer device file (PRTF) plus a single HLL program.

PRTOBJ

Each PRTOBJ function specifies the layout and processing you will use when printing records from an access path.

· A PRTOBJ function must be based on a Retrieval (RTV), Resequence (RSQ), or Query (QRY) access path.

· The access path may contain several key fields, giving rise to several formats in the report design layout, and several key breaks in the logic of the action diagrams for the function.

· Each PRTOBJ function has its own default report design which can be edited.

· Page headings are not specified.

Modifying Report Design Formats

Report designs are made up of report design formats.

When you first create a report by nominating an access path and a report function type, Synon automatically defines the appropriate formats for the report design.

There are eight different report design formats.

A typical report includes some or all of the following formats.

· The Report Heading Format includes the title, originator, and page information, defined by a Define Report Format (DFNRPTFMT) function.There is one Report Heading format per Print File function.  This appears at the beginning of the report and on each page of the report. This format cannot be dropped or hidden.

· The Top of Page Heading Format includes the information to be repeated on each page. By default this format is empty. There is one Top of Page Heading format per PRTFIL function. The information on this format is specific to the individual report. This format is not available for PRTOBJ.

· The First Page Heading Format includes the information to be printed before the first level heading or detail records for a given print function. By default, this format is empty. There is one First Page Heading format per report function (PRTOBJ or PRTFIL) only printed once per report function.

· The Level Heading Format contains fields appropriate to the key level. There is one key field per report function (PRTOBJ or PRTFIL). By default, this format is printed before the first detail or subheading within a level break. If the access path contains only one key field this format is omitted.

· The Detail Format contains fields from the based on access path. There is one Detail format per report function (PRTOBJ or PRTFIL). By default, this format is printed for every record read. This format cannot be dropped, only hidden.

· The Level Total Format contains fields appropriate to the key level. There is one level total format per level break per report function (PRTOBJ or PRTFIL). By default, this format is printed after the last detail record or subtotal within a level break. If the access path contains only one key field this format is omitted.

· The Final Total Format contains totals of all previous total levels. By default, this format contains only the constant Final Totals; user fields must be added for totalling. By default, this format is printed after the last level total format.

· The End of Report Format (report footer) at the end of the report, is defined by a Define Report Format (DFNRPTFMT) function type.

There is one End of Report format per PRTFIL. This format is printed after all other formats in the report. This format is not available for PRTOBJ. These format types are present on PRTFIL and PRTOBJ functions.

The following example shows the general appearance of a report design, including report design format types and page headings.

Example 1: Simple Report Design

Relations Consider the following relations to model customer information by geographical region:

If you wanted to produce a report of customers by geographical region:

Access Path Entries A Retrieval access path built over the Customer file might contain the entries shown below.

Default Report Formats A report design built over the access path shown in the preceding topic would contain the following report design formats:

Report Design Fields by Format The device design formats would by default contain the following fields:

Function Fields You can also add to the report device design a total count of the number of machines on each format.

Post Comments