In addition to page headings and footings, you can include section headings and footings in a report. You can use the SUBHEAD command in conjunction with a sort field you specify to produce section headings. Remember from Sorting Records, that sort fields are fields that immediately follow BY or ACROSS in a request. The section heading repeats each time the value of the specified sort field changes. You can use the ON TABLE PAGE_BREAK AND SUBHEAD command to produce a heading that appears only once at the beginning of the report and on its own page.
The format of the SUBHEAD command is:
ON {sort_field|TABLE} [PAGE-BREAK AND] SUBHEAD "text"
You provide the text for the section heading.
To include a SUBHEAD and HEADING CENTER command, issue the following request:
TABLE FILE EMPLOYEE HEADING CENTER "TOTAL CLASSROOM HOURS USED PER JOB CATEGORY" " " SUM ED_HRS BY DEPARTMENT BY CURR_JOBCODE ON DEPARTMENT SUBHEAD " " "------NEXT DEPARTMENT ------" " " RUN
Run the request. The output is:
This report spans two pages. Notice that the section heading for the Production department is not redisplayed on page 2. This is because a section heading appears only once before each sort field. The page heading, however, does appear on both pages. Compare the request to the report and you see the correlation between the blank lines in the report and the " " in the request.
You can force each department to begin on a new page, using PAGE-BREAK. For more information on using PAGE-BREAK see Creating a New Page: PAGE-BREAK. In Conditionally Displaying Section Headings and Footings: WHEN, you learn how to conditionally display section headings using WHEN.
WebFOCUS | |
Feedback |