Creating Headings and Footings
There are several types of headings and footings:
- Report titles. These are titles you define that display in your browser's title bar when you run a report or graph in HTML or, as the worksheet tab name in an EXL2K report. For details see, Creating Headings and Footings.
- A report heading, which appears at the top of the first page of a report and a report footing, which appears on the last page of a report. For details on report headings and footings, see Creating Headings and Footings.
- A page heading, which appears at the top of every page of a report and a page footing, which appears at the bottom of every page of a report. For details on page headings and footings, see Creating Headings and Footings.
- A sort heading,
which appears in the body of a report to identify the beginning
of a group of related data. And a sort footing, which appears in
the body to identify the end of a group of related data. For details
on sort headings and footings, see Creating Headings and Footings.
The following sample report contains a report heading at the beginning of the report and a report footing at the end of the report. It also contains a page heading and page footing on every page of the report.
The following sample report contains sort headings and sort footings, as well as, a page heading and page footing for reference.
A sort heading looks like this:
A sort footing looks like this:
Limits for Headings and Footings
The following limitations apply to report headings and footings, page headings and footings, and sort headings and footings:
- The space for headings, footings, subheadings, and subfootings is allocated dynamically. WebFOCUS imposes no limit on the amount of space used.
- The maximum number of sort headings plus sort footings in one request is 64.
- The maximum limit of nested headings is 64.
- If your code for a single heading or footing line is broken into multiple lines in the report request, you can indicate that they are all a single line of heading using the <0X spot marker. For more information, see Creating Headings and Footings.
- For PDF and Postscript reports, the heading or footing lines must fit within the maximum report width to be displayed properly. Also, in order for the report body to be displayed, the number of heading or footing lines must leave room on the page for at least one detail line (including column titles).
Extending Heading and Footing Code to Multiple Lines in a Report Request
A single line heading or footing code, between double quotation marks, can be a maximum of 32K characters. However, in some editors the maximum length of a line of code in a procedure is 80 characters. In cases like this, you can use the <0X spot marker to continue your heading onto the next line. The heading or footing content and spacing appears exactly as it would if typed on a single line.
Even if you do not need to extend your code beyond the 80-character line limit, this technique offers convenience, since shorter lines may be easier to read on screen and to print on printers.
Extend Heading or Footing Code to Multiple Lines in a Report Request
- Procedure
- Begin the heading or footing with double quotation marks (").
- Split the heading or footing content into multiple lines of up to 76 characters each, using the <0X spot marker at any point up to the 76th character to continue your heading onto the next line. (The four remaining spaces are required for the spot marker itself, and a blank space preceding it.)
- The heading or footing line can contain a maximum of 410 characters, with each line ending in an <0X spot marker.
- Place the closing double quotation marks at the end of the final line of heading or footing code.
You can use this technique to create a report heading or footing, page heading or footing, or sort heading or footing of up to 410 characters.
Extending Heading and Footing Code to Multiple Lines in a Report Request
This request creates a sort heading coded on two lines. The <0X spot marker positions the first character on the continuation line immediately to the right of the last character on the previous line. (No spaces are inserted between the spot marker and the start of a continuation line.)
SET ONLINE-FMT = HTML SET PAGE-NUM = OFF JOIN STORE_CODE IN CENTCOMP TO STORE_CODE IN CENTORD
TABLE FILE CENTCOMP HEADING "Century Corporation Orders Report" PRINT PROD_NUM QUANTITY LINEPRICE BY STORE_CODE NOPRINT BY ORDER_NUM ON STORE_CODE SUBHEAD "Century Corporation orders for store <STORENAME <0X (store # <STORE_CODE|) in <STATE|." ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ TYPE=HEADING, FONT='ARIAL', STYLE=BOLD, $ TYPE=SUBHEAD, OBJECT=FIELD, ITEM=2, STYLE=ITALIC, $ TYPE=SUBHEAD, OBJECT=FIELD, ITEM=3, STYLE=BOLD, $ ENDSTYLE END
The partial output is:
Creating a Custom Report or Worksheet Title
You can create a report title that:
- Overrides the default report title (FOCUS Report) that appears in the title bar of your browser in an HTML report or graph.
- Replaces the default worksheet tab name with the name you specify in an EXL2K report.
The worksheet tab names for an Excel Table of Contents report are the BY field values that correspond to the data on the current worksheet. If the user specifies the TITLETEXT keyword in the stylesheet, it will be ignored.
- Excel limits the length of worksheet titles to 31 characters. The following special characters cannot be used: ':', '?', '*', and '/'.
- If you want to use date fields as the bursting BY field, you can include the - character instead of the / character. The - character is valid in an Excel tab title. However, if you do use the / character, WebFOCUS will substitute it with the - character.
Create a Custom Report Title
TYPE=REPORT, TITLETEXT='title', $
where:
Is the text for your title.
The maximum number of characters for:
- The worksheet tab name in an EXL2K report is 31. Any text that exceeds 31 characters will be truncated.
- The browser
title for an HTML report or graph is 95. This is a limit imposed
by the browser.
Text specified in the title is placed in the file as is and is not encoded. Special characters, such as <, >, and &, should not be used since they have special meaning in HTML and may produce unpredictable results.
Note: The words "Microsoft Internet Explorer" are always appended to any HTML report title.
Creating a Custom Report Title in an HTML Report
The following illustrates how you can replace the default report title in an HTML report using the TITLETEXT attribute in your StyleSheet.
TABLE FILE SHORT SUM PROJECTED REGION BY REGION ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, TITLETEXT='1999 Sales Report', $ TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The output is:
Creating a Custom Report Title in an EXL2K Report
The following illustrates how you can replace the default worksheet tab name in an EXL2K report using the TITLETEXT attribute in your StyleSheet.
TABLE FILE SHORT SUM PROJECTED_RETURN BY REGION ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET STYLE * TYPE=REPORT, TITLETEXT='1999 Sales Report', $ ENDSTYLE END
The output is:
Creating a Report Heading or Footing
A report heading appears before the first page and is one of the most important components of a report. It provides a unique name to a report and identifies its purpose or content. A short, single-line report heading may meet the needs of your user, or you may include multiple lines of appropriate information.
A report footing appears after the last page of a report. You might add a report footing to signal the end of data so the user knows that the report is complete. A report footing can also provide other information, such as the author of the report.
A report heading or footing can include text, fields, Dialogue Manager variables, images, and spot markers.
Create a Report Heading
Include the following syntax in a request. Each heading or footing line must begin and end with a double quotation mark.
ON TABLE [PAGE-BREAK AND] SUBHEAD "content ... " ["content ... "] . . . ["content ... "]
where:
The text must start on a line by itself, following the SUBHEAD command.
Text can be combined with variables and spot markers.
For related information, see Creating Headings and Footings.
Fields
(real
data source fields, virtual fields created with the DEFINE command
in a Master File or report request, calculated values created with the
COMPUTE command in a request, or a system field such as TABPAGENO).
You can qualify data source fields with certain prefix operators.
Dialogue Manager variables.
Images.
You
can include images in a heading or footing.
For details, see Including an Element in a Heading or Footing.
<+0>
divides
a heading or footing into items for formatting. For details, see Identifying
a Heading, Footing, Title, or FML Free Text.
</n
specifies
skipped lines. For details, see Controlling the Vertical Positioning of a Heading or Footing.
<-n
to
position the next character on the line. For details, see Positioning Headings, Footings, or Items Within Them.
<0X
continues
a heading or footing specification on the next line of the request.
For details, see Creating Headings and Footings.
Creating a Single-Line Report Heading
This request creates a single-line report heading that identifies the content of the report.
TABLE FILE GGSALES PRINT BUDDOLLARS DOLLARS BY STCD WHERE STCD EQ 'R1019' ON TABLE SUBHEAD "Sales Report for Store Code R1019" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET WEBVIEWER ON ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF,$ ENDSTYLE END
The output illustrates the placement of a report heading on a multi-page HTML report. The report heading is at the top of the first page.
Subsequent pages do not contain a heading.
Create a Report Footing
Include the following syntax in a request. Each heading or footing line must begin and end with a double quotation mark.
ON TABLE [PAGE-BREAK AND] SUBFOOT "content ... " ["content ... "] . . . ["content ... "]
where:
The text must start on a line by itself, following the SUBFOOT command.
Text can be combined with variables and spot markers.
For related information, see Creating Headings and Footings.
Fields
(real
data source fields, virtual fields created with the DEFINE command
in a Master File or report request, calculated values created with the
COMPUTE command in a request, or a system field such as TABPAGENO).
You can qualify data source fields with certain prefix operators.
Dialogue Manager variables.
Images.
You
can include images in a heading or footing.
For details, see Including an Element in a Heading or Footing.
<+0>
divides a heading
or footing into items for formatting. For details, see Identifying
a Heading, Footing, Title, or FML Free Text.
</n
specifies
skipped lines. For details, see Controlling the Vertical Positioning of a Heading or Footing.
<-n
to
position the next character on the line. For details, see Positioning Headings, Footings, or Items Within Them.
<0X
continues
a heading or footing specification on the next line of the request.
For details, see Creating Headings and Footings.
Creating a Single-Line Report Footing
This request creates a single-line report footing that identifies the author of the report.
TABLE FILE GGSALES PRINT UNITS WHERE UNITS GE 1400 BY STCD BY REGION WHERE REGION EQ 'Northeast' ON TABLE SUBFOOT "AUTHOR: MARY SMITH" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET WEBVIEWER ON ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF,$ ENDSTYLE END
The output illustrates the placement of a report footing on a multi-page HTML report. The report footing follows the data on the last page.
Creating a Page Heading or Footing
A page heading appears at the top of every page of a report, and a page footing appears at the bottom of every page.
Add a page heading to identify and reinforce the report content and purpose from page to page, or include a variable that customizes the heading on each page. For example, consider a report with employee bank account information, arranged by department. Information for each department appears on a separate page. The page heading for this report identifies the department addressed on each page (for example, ACCOUNT REPORT FOR PRODUCTION DEPARTMENT).
Add a page footing to supply information that warrants repetition on each page, such as the date of the report, or a reminder that it is confidential. You can also use a page footing to supply descriptive information about a report, such as PRELIMINARY or DRAFT COPY.
A page heading or footing can include text, fields, Dialogue Manager variables, images, and spot markers.
In addition, you can use page heading and footing syntax to create a free-form (non-tabular) report, in which you position data on a page using a layout of your own design. See Creating a Free-Form Report for details.
A TABLE request can have more than one page heading or footing. For each heading or footing, a WHEN clause against the data being retrieved can determine whether the heading or footing displays on the report output.
In a heading, the data for the WHEN clause and data field values displayed in the heading are based on the first line on the page. In a footing, the data for the WHEN clause and the data field values displayed in the footing are based on the last line on the page.
The CONDITION StyleSheet attribute enables you to identify a specific WHEN clause so that you can style each heading or footing separately. For information, see Identifying a Heading, Footing, Title, or FML Free Text.
Create a Page Heading
Include the following syntax in a request. Each heading or footing line must begin and end with a double quotation mark.
[HEADING [CENTER]] "content ... " ["content ... "] . . . ["content ... "]
where:
The text must start on a line by itself, following the HEADING command.
Text can be combined with variables and spot markers.
For related information, see Creating Headings and Footings.
Fields
(real
data source fields, virtual fields created with the DEFINE command
in a Master File or report request, calculated values created with the
COMPUTE command in a request, or a system field such as TABPAGENO).
You can qualify data source fields with certain prefix operators.
Dialogue Manager variables.
Images.
You
can include images in a heading or footing.
For details, see Including an Element in a Heading or Footing.
<+0>
divides a heading
or footing into items for formatting. For details, see Identifying
a Heading, Footing, Title, or FML Free Text.
</n
specifies
skipped lines. For details, see Controlling the Vertical Positioning of a Heading or Footing.
<-n
to
position the next character on the line. For details, see Positioning Headings, Footings, or Items Within Them.
<0X
continues
a heading or footing specification on the next line of the request.
For details, see Creating Headings and Footings.
Creating a Single-Line Page Heading
This request omits the command HEADING since the page heading text precedes the display command PRINT. The page heading includes text and an embedded field.
TABLE FILE EMPLOYEE "ACCOUNT REPORT FOR DEPARTMENT <DEPARTMENT" PRINT CURR_SAL BY DEPARTMENT BY HIGHEST BANK_ACCT BY EMP_ID ON DEPARTMENT PAGE-BREAK ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ ENDSTYLE END
The output illustrates the placement of a page heading on a multi-page HTML report. The page heading appears on both pages of the report, identifying the department to which the data applies. See Including an Element in a Heading or Footing for information on embedded field values. The first page of data applies to the MIS department.
The second page of data applies to the PRODUCTION department.
Create a Page Footing
Include the following syntax in a request. Each heading or footing line must begin and end with a double quotation mark.
FOOTING [CENTER] [BOTTOM] "content ... " ["content ... "] . . . ["content ... "]
where:
The text must start on a line by itself, following the FOOTING command.
Text can be combined with variables and spot markers.
For related information, see Creating Headings and Footings.
Fields
(real
data source fields, virtual fields created with the DEFINE command
in a Master File or report request, calculated values created with the
COMPUTE command in a request, or a system field such as TABPAGENO).
You can qualify data source fields with certain prefix operators.
Dialogue Manager variables.
Images.
You
can include images in a heading or footing.
For details, see Including an Element in a Heading or Footing.
<+0>
divides a heading
or footing into items for formatting. For details, see Identifying
a Heading, Footing, Title, or FML Free Text.
</n
specifies
skipped lines. For details, see Controlling the Vertical Positioning of a Heading or Footing.
<-n
positions
the next character on the line. For details, see Positioning Headings, Footings, or Items Within Them.
<0X
continues
a heading or footing specification on the next line of the request.
For details, see Creating Headings and Footings.
Creating a Multiple-Line Page Footing
This request creates a two-line page footing that identifies the data as preliminary and indicates when the final report will be available.
TABLE FILE GGSALES PRINT UNITS DOLLARS BY CATEGORY BY STCD WHERE TOTAL DOLLARS GE 25000 FOOTING "PRELIMINARY SALES FIGURES" "FINAL TO COME END OF MONTH" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET WEBVIEWER ON ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF,$ ENDSTYLE END
The partial output illustrates the placement of page footings on a multi-page HTML report. The page footing appears on both pages of the report.
Specify a Heading or Footing With a WHEN Clause
{HEADING [CENTER]|FOOTING} "text_and_data1" . . . "text_and_datan" WHEN expression
where:
Is the text and data for each heading or footing line.
Is an expression that resolves to TRUE or FALSE (1 or 0). If its value resolves to TRUE, the heading or footing is displayed. If the expression resolves to FALSE, the heading or footing is not displayed.
Usage Notes for Multiple Headings
- HEADING CENTER and FOOTING CENTER apply only to the specific heading or footing in which they are specified.
- A request can have a total of 120 headings, 120 footings, 120 subheadings, and 120 subfootings.
- Once you use the BOTTOM option on a footing, all subsequent footings also go to the bottom of the page.
Freezing HTML and AHTML Headings, Footings, and Column Titles
You may want to scroll the data in a report while freezing headings, column titles, and footings in order to see the context of the report output while scrolling.
Using StyleSheet attributes, you can set aside a scrollable area for HTML and AHTML report output.
The HTML HFREEZE reporting feature is supported with the browser versions listed in Web Browser Support for WebFOCUS. The HFREEZE feature is listed in the 8.1 Browser Support Matrix in the HTML Reporting Features section JavaScript components row.
Usage Notes for HTMLARCHIVE With HFREEZE
WebFOCUS interactive reporting features must have a connection to the WebFOCUS client in order to access the components required to operate successfully.
HTMLARCHIVE can be used to create self-contained HTML pages with user-defined images when client access is not available.
To generate HTML pages containing user-defined images that can operate interactively, use one of the following commands:
SET HTMLEMBEDIMG=ON SET HTMLARCHIVE=ON
Define BASEURL to point directly to the host machine where these files can be accessed using the following syntax:
SET BASEURL=http://{hostname:portnumber}
For more information on SET BASEURL, see Specifying a Base URL.
Create a Scrollable Area in an HTML Report
TYPE=REPORT,HFREEZE={OFF|ON|TOP|BOTTOM},[SCROLLHEIGHT={AUTO|nn[.n]}], $
where:
Does not freeze the heading, column titles, grand totals, and footing. OFF is the default.
Freezes the heading, column titles, grand totals, and footing.
Freezes the heading and column titles.
Freezes the grand totals and footing.
In an HFREEZE report, the output will be responsive and automatically fit to the height of the output container when the size of the output container changes.
When AUTOFIT=ON, the report automatically fits to the size of the output container (both vertically and horizontally) when the size of the output container changes.
Is the height, in inches, of the scrollable area. The default for non-mobile devices is 4 inches.
Create a Scrollable Area in an AHTML Report
TYPE=REPORT,HFREEZE={OFF|ON}, $
where:
Does not freeze the heading, column titles, grand totals, and footing. OFF is the default value.
Freezes the heading, column titles, grand totals, and footing.
HFREEZE With Blank Column Titles
The HTML HFREEZE reporting feature supports blank column titles. The vertical HFREEZE scroll bar will be aligned with the first row of report data.
Usage Notes for Freezing Areas of HTML Report Output
Report headers and footers can be frozen, while the data lines scroll in HTML and AHTML reports only. For all other output formats, the StyleSheet attribute HFREEZE is ignored. The request must include the setting ON TABLE SET HTMLCSS ON, which is the default.
The following HTML features are not supported with HFREEZE:
- HFREEZE does not support the placement of images in subheadings and subfootings within the frozen area in Internet Explorer. HFREEZE does support the placement of images in subheadings and subfootings within the frozen area in Mozilla Firefox®, Google Chrome™, and Microsoft Edge®.
- Accordion reports
- WRAP StyleSheet attribute
- Custom HTML tags or JavaScript
- Compound Reports
Usage Notes for Freezing Areas of AHTML Report Output
Report headers and footers can be frozen, while the data lines scroll in AHTML and HTML reports only. For all other output formats, the StyleSheet attribute HFREEZE is ignored. The request must include the setting ON TABLE SET HTMLCSS ON, which is the default.
The following AHTML features are not supported with HFREEZE:
- SET SUBTOTALS=ABOVE and SET SUBTOTALS=BELOW
In a standard AHTML report, the subtotals display below the data lines and the grandtotal row is anchored at the bottom of the frozen frame. This behavior occurs regardless of whether the SET SUBTOTALS command is used.
- HFREEZE does not support the placement of images in subheadings and subfootings within the frozen area.
- Accordion reports
Creating a Sort Heading or Footing
A sort heading is text that precedes a change in a sort field value, identifying the beginning of a group of related data. A sort footing is text that follows a change in a sort field value, identifying the end of a group of related data.
A sort heading or footing, which appears in the body of a report, helps you identify different areas of detail in a report. Sort headings or footings can include text, fields, Dialogue Manager variables, images, and spot markers.
By including a WHEN phrase in a request, you can generate a message, implemented as a sort heading or footing, for data that meets the criterion you define. For details on conditional formatting, see Controlling Report Formatting.
If you are using a RECAP command to create subtotal values in a calculation, you can replace the default RECAP label with a more meaningful sort footing by following the RECAP command for a field with a SUBFOOT command for that field. For details about the RECAP command, see Including Totals and Subtotals.
If one or more data fields are embedded in the sort footing, you can omit a display command from the report request since, by default, data fields in headings and footings are summed. If, however, a request does contain an explicit SUM command and a display field is also specified in the sort footing, the field in the sort footing is summed. You can omit the display command from other types of headings and footings as well. Note that the data for headings is taken from the first sort group and the data for footings is taken from the last sort group. For related information, see Creating Headings and Footings.
By default, WebFOCUS generates a blank line before a subheading or subfooting. You can eliminate these automatic blank lines by issuing the SET DROPBLNKLINE=ON command.
Alignment of Subheadings and Subfootings
By default, with SQUEEZE=ON, the right margin used for borders and backcolor for subheadings and subfootings is defined based on the maximum width of all heading, footing, subheading, and subfooting lines. The length of subheading and subfooting lines is tied to the lengths of the page heading and page footing, not to the size of the data columns in the body of the report. The ALIGN-BORDERS=BODY attribute in a StyleSheet allows you to align the subheadings and subfootings with the data/report body on PDF report output instead of the other heading elements.
Create a Sort Heading
Each heading or footing line must begin and end with a double quotation mark, unless you are using the line continuation spot marker (<ox).
BY fieldname SUBHEAD [NEWPAGE] "content ... " ["content ... "] . . . ["content ... "] [WHEN expression;] BY fieldname ON fieldname SUBHEAD [NEWPAGE] "content ... " ["content ... "] . . . ["content ... "] [WHEN expression;]
OR
BY fieldname ON fieldname SUBHEAD [NEWPAGE] "content ... " ["content ... "] . . . ["content ... "] [WHEN expression;]
where:
The text must start on a line by itself, following the SUBHEAD command.
Text can be combined with variables and spot markers.
For related information, see Creating Headings and Footings.
Fields
(real
data source fields, virtual fields created with the DEFINE command
in a Master File or report request, calculated values created with the
COMPUTE command in a request, or a system field such as TABPAGENO).
You can qualify data source fields with certain prefix operators.
Dialogue Manager variables.
Images.
You
can include images in a heading or footing.
For details, see Including an Element in a Heading or Footing.
<+0>
divides
a heading or footing into items for formatting. For details, see Identifying
a Heading, Footing, Title, or FML Free Text.
</n
specifies
skipped lines. For details, see Controlling the Vertical Positioning of a Heading or Footing.
<-n
to
position the next character on the line. For details, see Positioning Headings, Footings, or Items Within Them.
<0X
continues
a heading or footing specification on the next line of the request.
For details, see Creating Headings and Footings.
For details on conditional formatting, see Controlling Report Formatting. For related information, see Using Expressions.
You can use NEWPAGE with PDF reports.In HTML reports, blank space is added instead of a new page.
Creating a Sort Heading When a Product Description Changes
This request displays a sort heading each time the product description changes. The sort heading includes text and an embedded field.
TABLE FILE GGPRODS PRINT PACKAGE_TYPE AND UNIT_PRICE WHERE UNIT_PRICE GT 50 BY PRODUCT_DESCRIPTION NOPRINT BY PRODUCT_ID ON PRODUCT_DESCRIPTION SUBHEAD "Summary for <PRODUCT_DESCRIPTION" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The sort heading identifies the product that the next line of data applies to.
See Including an Element in a Heading or Footing for information on embedded field values.
Creating a Conditional Sort Heading
This request displays a sort heading for a category only if its sales fall below $17,000,000.
TABLE FILE GGSALES SUM DOLLARS BY CATEGORY SUBHEAD "<CATEGORY ALERT: SALES FALL BELOW $17,000,000" WHEN DOLLARS LT 17000000; ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
Sales for the category Gifts fall below the specified amount, as the sort heading warns. No other category is preceded by a sort heading.
See Including an Element in a Heading or Footing for information on embedded field values.
Create a Sort Footing
Each heading or footing line must begin and end with a double quotation mark.
For a single sort field, use the syntax
BY fieldname SUBFOOT [WITHIN] [MULTILINES] [NEWPAGE] "content ... " ["content ... "] . . . ["content ... "] [WHEN expression;] BY fieldname ON fieldname SUBFOOT [WITHIN] [MULTILINES] [NEWPAGE] "content ... " ["content ... "] . . . ["content ... "] [WHEN expression;]
For multiple sort fields, use the syntax
BY fieldname ON fieldname SUBFOOT [MULTILINES] [NEWPAGE] "content ... " ["content ... "] . . . ["content ... "] [WHEN expression;]
where:
The text must start on a line by itself, following the SUBFOOT command.
Text can be combined with variables and spot markers.
For related information, see Creating Headings and Footings.
Fields
(real
data source fields, a virtual fields created with the DEFINE command
in a Master File or report request, calculated values created with the
COMPUTE command in a request, a system field such as TABPAGENO).
You can qualify data source fields with certain prefix operators.
Dialogue Manager variables.
Images.
You
can include images in a heading or footing.
For details, see Including an Element in a Heading or Footing.
<+0>
divides
a heading or footing into items for formatting. For details, see Identifying
a Heading, Footing, Title, or FML Free Text.
</n
specifies
skipped lines. For details, see Controlling the Vertical Positioning of a Heading or Footing.
<-n
to
position the next character on the line. For details, see Positioning Headings, Footings, or Items Within Them.
<0X
continues
a heading or footing specification on the next line of the request.
For details, see Creating Headings and Footings.
For details on conditional formatting, see Controlling Report Formatting. For related information, see Using Expressions.
Creating a Sort Footing When a Product Description Changes
This request displays a sort footing each time the product description changes.
TABLE FILE GGPRODS PRINT PACKAGE_TYPE AND UNIT_PRICE WHERE UNIT_PRICE GT 50 BY PRODUCT_DESCRIPTION NOPRINT BY PRODUCT_ID ON PRODUCT_DESCRIPTION SUBFOOT "Summary for <PRODUCT_DESCRIPTION" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
See Including an Element in a Heading or Footing for information on embedded field values.
Creating a Conditional Sort Footing With Multiple Sort Options
This report lists orders, order dates, and order totals for the Century Corporation. It uses conditional sort footings to distinguish between orders that total more than $200,000 and less than $200,000.
Notice that one sort phrase (ON ORDER_NUM) specifies several sort-related options (two different SUBFOOT phrases), and that each option has its own WHEN phrase.
TABLE FILE CENTORD HEADING "Order Revenue" " " SUM ORDER_DATE LINEPRICE AS 'Order,Total:' BY HIGHEST 5 ORDER_NUM ON ORDER_NUM SUBFOOT "--- Order total is less than $200,000 ---" " " WHEN LINEPRICE LT 200000; SUBFOOT "+++ Order total is greater than or equal to $200,000 +++" " " WHEN LINEPRICE GE 200000; ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The following report appears.
Suppressing a Sort Footing
This request suppresses the sort footing for any product that has only one line of data (that is, a product that was only ordered one time on 01/01/96).
TABLE FILE GGORDER PRINT QUANTITY BY PRODUCT_CODE NOPRINT BY PRODUCT_DESCRIPTION WHERE ORDER_DATE EQ '01/01/96' WHERE STORE_CODE EQ 'R1019' WHERE PRODUCT_DESCRIPTION EQ 'Hazelnut' OR 'Biscotti' OR 'Croissant' ON PRODUCT_CODE SUBFOOT MULTILINES "<PRODUCT_DESCRIPTION has multiple orders." ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
In the output, the sort footing for Biscotti is suppressed.
Replacing the Default RECAP Label With a Sort Footing
In this request, a SUBFOOT command for the field DEPARTMENT follows a RECAP command for that field. The RECAP command creates subtotal values for the calculation.
TABLE FILE SHORT SUM BALANCE AS 'Dollars' ENGLAND_POUND AS 'Sterling' BY REGION WHERE REGION EQ 'FAR EAST' OR 'CENTRAL AMERICA' OR 'WESTERN EUROPE'; BY COUNTRY NOPRINT RECAP EURO/D16=BALANCE * 1.03; SUBFOOT " " "Balance of investments for <COUNTRY> in Euros is <EURO>." " " END
The sort footing text (for example, "Balance of investments for FRANCE in Euros is 87,336,971.") replaces the default label for the RECAP value (** EURO 87,336,971).
Omitting a Display Command in a Sort Footing
This request creates a complete report as a sort footing. It does not require a display command because the sort footing content contains the data fields DEPARTMENT and SALARY. By default, the field SALARY is summed in the sort footing.
TABLE FILE EMPLOYEE BY DEPARTMENT NOPRINT SUBFOOT "<DEPARTMENT DEPARTMENT TOTAL SALARY IS <SALARY" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE=REPORT, GRID=OFF, $ ENDSTYLE END
The output is:
Usage Notes for Subfoots
- SUBFOOT WITHIN is useful where a prefixed field within a sort break would result in a single value (for example, AVE., MIN, MAX). Use of PCT. or APCT. displays only the last value from the sort group.
- SUBFOOT WITHIN "<prefix.fieldname " does not result in the same value as SUBTOTAL prefix. The SUBFOOT WITHIN creates a display field that operates on the original input records. SUBTOTAL with a prefix operates on the internal matrix (so AVE. is the average of the SUMS or, if a display field had the prefix AVE., the average of the averages). SUBFOOT WITHIN "<AVE.field " generates an overall average.
- Prefix operators are not supported on alphanumeric fields in a WITHIN phrase.
- The ST. prefix operator is not supported in a SUBFOOT WITHIN phrase.