How to: |
You can apply formatting to an:
You can also identify an entire horizontal sort (ACROSS) title or value row in a StyleSheet, although each of these rows contains only a single kind of information. For details, see Identify a Column Title.
The following illustrates where the REPORT component and the COLUMN and ACROSSCOLUMN attributes appear in a report, and which TYPE values you use to identify them. Although in this example the value for COLUMN is B1 and the value for ACROSSCOLUMN is N2, these are not the only values you can use to identify these components.
TABLE FILE CENTORD SUM LINEPRICE LINE_COGS AS 'Line Cost of,Goods Sold' BY PLANT AS 'Plant' ACROSS YEAR WHERE YEAR EQ 2000 or 2001 HEADING "Cost Analysis" FOOTING CENTER "**End of Report**" ON TABLE SET PAGE-NUM OFF END
Note: Since this request simply illustrates where the components appear in a report, it omits a StyleSheet.
To identify an entire report in a StyleSheet, use this attribute and value:
TYPE=REPORT
The following illustrates how to identify and apply formatting to an entire report. The relevant StyleSheet declarations are highlighted in the request.
TABLE FILE CENTINV HEADING "Excess Stock Report" SUM QTY_IN_STOCK BY PRODNAME WHERE QTY_IN_STOCK GT 10000 FOOTING CENTER "**End of Report**" ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ TYPE=REPORT, STYLE=BOLD,$ ENDSTYLE END
The output is:
TYPE=REPORT, coltype=column
where:
Specifies the type of column. It can be:
Specifies one or more columns. If you are identifying an ACROSSCOLUMN, the only valid identifiers are Nn and Pn, and these only count ACROSS fields, not display fields.
Options for identifying columns in a StyleSheet are:
Identifier |
Description |
---|---|
Nn |
Identifies a column by its position in the report. To determine this value, count vertical sort (BY) fields, display fields, and ROW-TOTAL fields, from left to right, including NOPRINT fields. For ACROSSCOLUMN, only ACROSS fields are counted. |
Pn |
Identifies a column by its position in the report. To determine the value of n, count vertical sort (BY) fields, display fields, and ROW-TOTAL fields from left to right. Do not count NOPRINT fields. For ACROSSCOLUMN, only ACROSS fields are counted. |
Cn |
Identifies a display column by its position in the report. To determine the value of n, count only display fields from left to right, including NOPRINT fields. Do not count vertical sort (BY) fields or ROW-TOTAL fields. To select all display fields use C*. |
Bn |
Identifies a vertical sort (BY) column by its position in the report. To determine the value of n, count only vertical sort (BY) fields, including NOPRINTs, from left to right. To select all BY fields use B*. |
field |
Identifies a column by its field name. When a field occurs more than once, use field(n) to select a particular occurrence or field(*) to select all occurrences of the field. |
ROWTOTAL |
Identifies a column of row totals generated using ROW-TOTAL. When used with ACROSS and multiple display commands, ROWTOTAL generates multiple total columns. Use ROWTOTAL(n) to select a particular total column. Use ROWTOTAL(field) to select the row total column for a particular field. Use ROWTOTAL(*) to select all row total columns in the report. |
Note: Within a StyleSheet, all columns must be specified in the same way, either by field name or positional reference.
The following illustrates how to identify an entire column, which consists of the column data and the column title, in a report. The relevant StyleSheet declaration is highlighted in the request.
Note: To produce the same results you can, alternatively, use the values P1, B1, or the fieldname (PRODNAME) for the COLUMN attribute in the StyleSheet declaration.
TABLE FILE CENTINV HEADING "Excess Stock Report" SUM QTY_IN_STOCK BY PRODNAME WHERE QTY_IN_STOCK GT 10000 FOOTING CENTER "**End of Report**" ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ TYPE=REPORT, COLUMN=N1, STYLE=ITALIC,$ ENDSTYLE END
The output is:
The following illustrates how to identify a horizontal (ACROSS) column. When you identify and format an ACROSSCOLUMN, all data values, the column title, and any horizontal sort (ACROSS) values associated with the field are formatted for every instance of the column in the report output. The relevant StyleSheet declarations are highlighted in the request.
Note: To produce the same results you can alternatively use the values P1 and P2, respectively, for the ACROSSCOLUMN attribute.
TABLE FILE CENTORD SUM LINEPRICE LINE_COGS AS 'Line Cost of,Goods Sold' BY PLANT AS 'Plant' ACROSS YEAR WHERE YEAR EQ 2000 OR 2001 HEADING "Cost Analysis" FOOTING CENTER "**End of Report**" ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF,$ TYPE=REPORT, ACROSSCOLUMN=N1, STYLE=ITALIC,$ TYPE=REPORT, ACROSSCOLUMN=N2, STYLE=BOLD,$ ENDSTYLE END
The output is:
TYPE=REPORT, LABEL=label
where:
Is an explicit row label.
The following illustrates how to identify an entire FML row, consisting of the row label and the row data. The relevant StyleSheet declarations are highlighted in the request.
TABLE FILE LEDGER SUM AMOUNT FOR ACCOUNT 1010 AS 'CASH ON HAND' LABEL COH OVER 1020 AS 'DEMAND DEPOSITS' LABEL DD OVER 1030 AS 'TIME DEPOSITS' LABEL TD OVER BAR OVER RECAP TOTCASH = R1 + R2 + R3; AS 'TOTAL CASH' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=REPORT, LABEL=COH, STYLE=ITALIC, $ TYPE=REPORT, LABEL=DD, STYLE=ITALIC, $ TYPE=REPORT, LABEL=TD, STYLE=ITALIC, $ ENDSTYLE END
The output is:
TYPE=type, [BY=sortcolumn]
where:
Identifies a subtotal or total. Select from:
GRANDTOTAL which is a grand total (generated by COLUMN-TOTAL, SUBTOTAL, SUB-TOTAL, RECOMPUTE, or SUMMARIZE).
SUBTOTAL which is a subtotal (generated by SUBTOTAL, SUB-TOTAL, RECOMPUTE, or SUMMARIZE).
RECAP which is a subtotal calculation (generated by ON sortfield RECAP or ON sortfield COMPUTE).
When there are several subtotal commands, each associated with a different vertical sort (BY) column, this enables you to identify which of the subtotal commands you wish to format.
Specifies the vertical sort (BY) column associated with one of the several subtotal in the report commands. Use the field name to identify the sort column.
The following illustrates how to identify an entire COLUMN-TOTAL row in a StyleSheet. The relevant StyleSheet declaration is highlighted in the request.
TABLE FILE SALES SUM RETURNS DAMAGED AND ROW-TOTAL AND COLUMN-TOTAL BY PROD_CODE ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=GRANDTOTAL, STYLE=BOLD, SIZE=12, $ ENDSTYLE END
The output is:
The following illustrates how to identify a row total. The relevant StyleSheet declaration is highlighted in the request. Note that if you want to format an instance of row-total, you can add a WHEN statement to your StyleSheet. For details, see Controlling Report Formatting.
TABLE FILE SALES SUM RETURNS DAMAGED AND ROW-TOTAL BY PROD_CODE AS 'PRODUCT,CODE' ON TABLE SET PAGE-NUM OFF ON TABLE SET STYLE * TYPE=REPORT, GRID=OFF, $ TYPE=REPORT, COLUMN=ROWTOTAL, STYLE=BOLD, $ ENDSTYLE END
The output is: