In this section: |
A report data is framed by headings, footings, and titles. These provide context for the data. You can identify and format many categories of headings, footings, and titles in a report, including:
How to: |
Within a StyleSheet you can identify column titles and horizontal sort (ACROSS) values of a report in order to format them. The following example illustrates where column titles and horizontal sort values are in a report, and which TYPE values you use to identify them.
TABLE FILE EMPLOYEE SUM GROSS AND DED_AMT ACROSS DEPARTMENT BY PAY_DATE END
Note: Since this request simply illustrates how to identify column titles and horizontal sort values in a report, it omits a StyleSheet.
TYPE=TITLE, [COLUMN=column]
where:
Is used to specify one or more column titles. If you omit this attribute and value, the formatting will be applied to all of the report column titles.
Specifies the column whose title you wish to format. For column values, see Identify an Entire Column.
TYPE={ACROSSTITLE|ACROSSVALUE}, [ACROSS=column]
where:
Specifies a horizontal sort (ACROSS) title.
Specifies a horizontal sort (ACROSS) value.
Although horizontal sort values are not technically titles, they often function as titles that categorize the column titles appearing beneath them.
Is used to specify titles or values for a specific horizontal sort field. If you omit this attribute and value, the formatting will be applied to the titles or values of the horizontal sort fields of all reports.
Specifies the horizontal sort (ACROSS) field whose title or values you wish to format. For values you can assign to this attribute, see Identify a Row of Horizontal Sort (ACROSS) Data.
This example illustrates how to identify vertical sort titles, horizontal sort titles, and horizontal sort values. The vertical sort titles (TYPE=TITLE) are Manufacturing Plant, Quantity Sold and Product Cost, the horizontal sort title (TYPE=ACROSSTITLE) is Year, and the horizontal sort values (TYPE=ACROSSVALUE) are 2001, 2002, and TOTAL.
The following also demonstrates how to assign drill-down values to the individual ACROSS values of 2001 and 2002, and not the ROW-TOTAL value of TOTAL. The StyleSheet declarations in this request are shown in bold.
TABLE FILE CENTORD SUM QUANTITY AS 'Quantity,Sold' LINE_COGS/I9 AS 'Product,Cost' BY PLANT ACROSS YEAR WHERE YEAR EQ '2001' OR '2002' HEADING "Plant Production Cost Analysis" ON TABLE ROW-TOTAL AS 'TOTAL' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ TYPE=TITLE, STYLE=BOLD, $ TYPE=ACROSSTITLE, STYLE=BOLD, $ TYPE=ACROSSVALUE, STYLE=BOLD+ITALIC, COLOR=BLUE, FOCEXEC=DETAILS, $ TYPE=ACROSSVALUE, COLUMN=N4, STYLE=BOLD, COLOR=RED, $ TYPE=ACROSSVALUE, COLUMN=ROWTOTAL(1), COLOR='BLACK',FOCEXEC=NONE, $ ENDSTYLE END
The following image shows the report output.
TYPE=FREETEXT, LABEL={Rn|label}
where:
Is an implicit row label. To determine the value of n, count the number of rows up to and including the desired row.
Is an explicit row label.
The following illustrates how to identify free text in an FML report. In this example, the free text are the rows "CASH ACCOUNTS" and "OTHER CURRENT ASSETS". The relevant StyleSheet declarations are displayed in bold.
TABLE FILE LEDGER SUM AMOUNT FOR ACCOUNT " --- CASH ACCOUNTS ---" LABEL CA OVER 1010 AS 'CASH ON HAND' OVER 1020 AS 'DEMAND DEPOSITS' OVER 1030 AS 'TIME DEPOSITS' OVER " " OVER " --- OTHER CURRENT ASSETS ---" LABEL OCA OVER 1100 AS 'ACCOUNTS RECEIVABLE' OVER 1200 AS 'INVENTORY' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=FREETEXT, LABEL=CA, STYLE=BOLD, SIZE=12, $ TYPE=FREETEXT, LABEL=OCA, STYLE=BOLD, SIZE=12, $ ENDSTYLE END
The output is:
How to: |
Within a StyleSheet you can identify a report headings and footings, and the individual lines, text strings, and fields within them, in order to format them.
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. The CONDITION StyleSheet attribute enables you to identify a specific WHEN clause so that you can style each heading or footing separately.
The following code and output examples illustrate where a report heading (TABHEADING), a page heading (HEADING), a sort heading (SUBHEAD), a sort footing (SUBFOOT), and a report footing (TABFOOTING) are in a report, and which TYPE values you use to identify them.
TABLE FILE EMPLOYEE PRINT CURR_SAL HIRE_DATE BY LAST_NAME BY FIRST_NAME ON TABLE SUBHEAD "CONFIDENTIAL INFORMATION" "SWIFTY INFORMATION GROUP - EMPLOYEE LIST BY DEPARTMENT" HEADING CENTER "</1>EMPLOYEE LIST FOR DEPARTMENT: <DEPARTMENT" ON LAST_NAME SUBHEAD "ID: <EMP_ID" ON LAST_NAME SUBFOOT "** REVIEW SALARY FOR <FIRST_NAME <LAST_NAME" FOOTING "CONFIDENTIAL INFORMATION" ON TABLE SUBFOOT "</1>***END OF REPORT***" ON TABLE SET ONLINE-FMT STANDARD END
The following output goes with the previous code example:
Note: Since this request simply illustrates how to identify different types of headings and footings, it omits a StyleSheet.
TYPE=headfoot, [BY=sortcolumn]
where:
Identifies a heading or footing. Select from:
When there are several sort headings or sort footings, each associated with a different vertical sort (BY) column, this enables you to identify which sort heading or sort footing you wish to format.
If there are several sort headings or sort footings associated with different vertical sort (BY) columns, and you omit this attribute and value, the formatting will be applied to all of the sort headings or footings.
Specifies the vertical sort (BY) column associated with one of the report sort headings or sort footings.
The following illustrates how to identify a page heading, which appears at the top of every report page, and a report footing, which appears only on the last page of the report. The relevant StyleSheet declarations are highlighted in the request.
TABLE FILE CENTORD HEADING "Sales Quantity and Amount by Plant" SUM QUANTITY LINEPRICE BY PLANT ON TABLE SUBFOOT " " "***End of Report***" ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=HEADING, FONT=TIMES, SIZE=12, STYLE=BOLD,$ TYPE=TABFOOTING, JUSTIFY=CENTER, STYLE=BOLD, SIZE=11,$ ENDSTYLE END
The output is:
TYPE=type, LINE=line_#
where:
Identifies a type of heading or footing. Select from HEADING, FOOTING, TABHEADING, TABFOOTING, SUBHEAD, or SUBFOOT. For details, see Identify a Heading or Footing.
Identifies a line by its position in the heading or footing.
The following example illustrates how to format individual lines in a heading. Heading line 1 (Sales Quantity Analysis) is formatted in bold, point-size 11. Heading line 2 (**Confidential**) is formatted in bold and red. The relevant StyleSheet declarations are highlighted in the request.
TABLE FILE CENTORD HEADING "Sales Quantity Analysis" "**Confidential**" " " SUM QUANTITY ACROSS YEAR BY PLANT ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=HEADING, LINE=1, SIZE=11, STYLE=BOLD,$ TYPE=HEADING, LINE=2, COLOR=RED, STYLE=BOLD,$ TYPE=HEADING, JUSTIFY=CENTER,$ ENDSTYLE END
The output is:
TYPE=type, [LINE=line_#], [OBJECT=TEXT], ITEM=item_#
where:
Identifies a type of heading or footing. Select from HEADING, FOOTING, TABHEADING, TABFOOTING, SUBHEAD, or SUBFOOT. For details, see Identify a Heading or Footing.
Identifies a line by its position in the heading or footing. You only need to include the LINE attribute if you have a multi-line heading or footing.
Formats only text strings and Dialogue Manager variables (also known as &variables). It is not necessary to use OBJECT=TEXT in your declaration unless you are styling both text strings and embedded fields in the same heading or footing.
Identifies an item by its position in a line.
If you need to apply formatting to several parts of a continuous text string that displays on one line, you can break the header or footer into multiple parts using spot markers. Place the spot marker after the text string you wish to specify. The <+0> spot marker will not add any additional spaces to your heading or footing. When using spot markers, text is divided as follows:
Note: When a closing spot marker is immediately followed by an opening spot marker (><), a single space text item will be placed between the two spot markers (> <). This must be considered when applying formatting.
The position value also depends on whether you are using the OBJECT attribute or not. If you are using:
The following illustrates how to apply different formats to text strings in a heading using spot markers. The spot markers used in this example are <+0> since they do not add any spaces. The relevant StyleSheet declarations are highlighted in the request.
TABLE FILE CENTORD HEADING "Third Quarter,<+0>2002:<+0> Sales Quantity Analysis" SUM QUANTITY BY PLANT ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=HEADING, OBJECT=TEXT, ITEM=1, STYLE=BOLD+UNDERLINE, SIZE=12, $ TYPE=HEADING, OBJECT=TEXT, ITEM=2, COLOR=BLUE, SIZE=12, STYLE=BOLD+UNDERLINE, $ TYPE=HEADING, OBJECT=TEXT, ITEM=3, STYLE=ITALIC,$ ENDSTYLE END
The output is:
TYPE=type, [LINE=line_#], OBJECT=FIELD, [ITEM=item #]
where:
Identifies a type of heading or footing. Select from HEADING, FOOTING, TABHEADING, TABFOOTING, SUBHEAD, or SUBFOOT. For details, see Identify a Heading or Footing.
Identifies a line by its position in the heading or footing. You only need to include the LINE attribute if you have a multi-line heading or footing.
Identifies an item by its position in a line.
If you have more than one embedded field in a heading or footing, you must specify the field you wish to format by giving the item number. Count items from left to right. Do not include text fields in the count. You do not need to specify the item number if there is only one embedded field in the heading or footing.
Note: BORDER options are not supported on specific ITEMS in a HEADING, FOOTING, SUBHEAD, SUBFOOT.
The following illustrates how to format an embedded field in a heading. Notice that the item number is not specified in the StyleSheet declaration since there is only one embedded field in the heading. The relevant StyleSheet declaration is highlighted in the request.
TABLE FILE CENTORD HEADING "Sales For <YEAR By Plant" SUM QUANTITY BY PLANT WHERE YEAR EQ 2000 ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=HEADING, OBJECT=TEXT, COLOR=BLUE,$ TYPE=HEADING, OBJECT=FIELD, COLOR=RED, STYLE=BOLD,$ ENDSTYLE END
The output is:
TYPE = {HEADING|FOOTING}, CONDITION = n, ... ,$
where:
Is the number of the WHEN condition in the heading or footing from top to bottom. If not specified, formatting applies to all headings and footings.
The following request displays a page for each employee with salary and job code information for that employee. The first WHEN condition applies if the employee is female. The second WHEN condition applies if the employee is male. The third WHEN condition applies if the department is MIS. The fourth WHEN condition applies if the department is PRODUCTION. The StyleSheet declarations include styling elements for the second and third conditions:
DEFINE FILE EMPLOYEE GENDER/A1 = DECODE FIRST_NAME(ALFRED 'M' RICHARD 'M' JOHN 'M' ANTHONY 'M' ROGER 'M' MARY 'F' DIANE 'F' JOAN 'F' ROSEMARIE 'F' BARBARA 'F'); MIXEDNAME/A15 = LCWORD(15, LAST_NAME, MIXEDNAME); NAME/A16 = MIXEDNAME||','; END TABLE FILE EMPLOYEE PRINT LAST_NAME NOPRINT GENDER NOPRINT NAME NOPRINT HEADING "Dear Ms. <NAME" WHEN GENDER EQ 'F'; HEADING "Dear Mr. <NAME>" WHEN GENDER EQ 'M'; HEADING " " HEADING "This is to inform you that your current salary is " "<CURR_SAL and <CURR_JOBCODE>is your job code." " " "Sincerely," HEADING "Barbara Cross " WHEN DEPARTMENT EQ 'MIS'; HEADING "John Banning " WHEN DEPARTMENT EQ 'PRODUCTION' ; WHERE LAST_NAME NE 'BANNING' OR 'CROSS' BY EMP_ID NOPRINT PAGE-BREAK ON TABLE SET PAGE NOPAGE ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLE * TYPE=HEADING, CONDITION=2, STYLE=ITALIC,$ TYPE=HEADING, CONDITION=3, STYLE=BOLD,$ ENDSTYLE END
In the StyleSheet for the request, heading lines displayed because of the first condition are in italics and heading lines displayed because of the third condition are in boldface.
The first page of output is for a male employee, so the greeting line is in italics:
The second page of output is for an employee in the MIS department, so the signature line is in boldface: