How to: |
With HEADALIGN=BODY, each heading or footing element is aligned with a data column in an HTML or PDF report. With HEADALIGN=INTERNAL, each element is continued in a column of an HTML table created and aligned specifically for the report heading or footing. By default, every heading or footing element (ITEM) is placed in the first available column. However, you can position an item to span multiple columns using the COLSPAN attribute. For details about HEADALIGN options, see Aligning a Heading or Footing Element in an HTML Report.
You must specify the HEADALIGN and COLSPAN attributes in two separate StyleSheet declarations, since HEADALIGN applies to an entire heading or footing, while COLSPAN applies to a specific item in a heading or footing.
TYPE = headfoot, [subtype,] COLSPAN = n, $
where:
Is the type of heading or footing. Valid values are TABHEADING, TABFOOTING, HEADING, FOOTING, SUBHEAD, and SUBFOOT.
Are additional attributes that identify the report component. These options can be used separately or in combination, depending upon the degree of specificity required to identify an element. Valid values are:
If a heading or footing has multiple lines and you apply a StyleSheet declaration that does not specify LINE, the declaration is applied to all lines. Blank lines are counted when interpreting the value of LINE.
It is not necessary to specify OBJECT=TEXT unless you are styling both text strings and embedded fields in the same heading or footing.
To determine the ITEM for an OBJECT, follow these guidelines:
If you apply a StyleSheet declaration that specifies ITEM, the number is counted from the beginning of each line in the heading or footing, not just from the beginning of the first line.
In this request, HEADALIGN=INTERNAL creates a three-column embedded HTML table for the heading. The COLSPAN attribute then centers the first line of the heading, Gotham Grinds, Inc., over the report, spanning the three columns in the embedded HTML table.
TABLE FILE GGORDER HEADING "Gotham Grinds, Inc." " " "Orders Report <+0> <+0> Run on: &DATE" " " PRINT ORDER_NUMBER ORDER_DATE STORE_CODE QUANTITY BY PRODUCT_CODE BY PRODUCT_DESCRIPTION IF RECORDLIMIT EQ 10 ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE = REPORT, GRID = OFF, $ TYPE = HEADING, HEADALIGN = INTERNAL, $ TYPE = HEADING, LINE=1, COLSPAN=3, STYLE = BOLD, JUSTIFY=CENTER, $ TYPE = HEADING, LINE=3, ITEM=3, JUSTIFY=RIGHT, $ ENDSTYLE END
The output is:
In this request, HEADALIGN=BODY aligns the sort footing in the same HTML table as the body of the report. COLSPAN = 5 positions the first item in the sort footing (the text Total) in the fifth column of the HTML table. The second item in the sort footing (the field <ST.QUANTITY) is positioned in the next available column.
The HEADALIGN attribute is on a separate line from the COLSPAN attribute because it applies to the entire sort footing (and consequently to both items), whereas COLSPAN applies to the single item Total.
TABLE FILE GGORDER PRINT ORDER_NUMBER ORDER_DATE STORE_CODE QUANTITY BY PRODUCT_CODE BY PRODUCT_DESCRIPTION WHERE ORDER_DATE EQ '01/01/96' WHERE STORE_CODE EQ 'R1019' ON PRODUCT_CODE SUBFOOT "Total: <ST.QUANTITY" ON TABLE SET PAGE-NUM OFF ON TABLE SET ONLINE-FMT HTML ON TABLE SET STYLESHEET * TYPE = REPORT, GRID = OFF, $ TYPE = SUBFOOT, HEADALIGN = BODY, JUSTIFY = RIGHT, STYLE = BOLD, $ TYPE = SUBFOOT, OBJECT = TEXT, COLSPAN = 5, $ ENDSTYLE END
The partial output is:
In this request, HEADALIGN=BODY aligns the sort footing in the same grid as the body of the report. COLSPAN=5 positions the first item in the sort footing (the text Total) in the fifth column of the report output. The second item in the sort footing (the field <ST.QUANTITY) is positioned in the next available column. The subfooting items are right justified.
The HEADALIGN attribute is on a separate line from the COLSPAN attribute because it applies to the entire sort footing (and consequently to both items), whereas COLSPAN applies only to the text item Total.
TABLE FILE GGORDER PRINT ORDER_NUMBER ORDER_DATE STORE_CODE QUANTITY BY PRODUCT_CODE BY PRODUCT_DESCRIPTION WHERE ORDER_DATE EQ '01/01/96' WHERE STORE_CODE EQ 'R1019' ON PRODUCT_CODE SUBFOOT "Total:<ST.QUANTITY" "" ON TABLE SET PAGE-NUM OFF ON TABLE PCHOLD FORMAT PDF ON TABLE SET STYLESHEET * TYPE=REPORT, FONT=ARIAL, SQUEEZE=ON,$ TYPE = SUBFOOT, HEADALIGN = BODY, JUSTIFY = RIGHT, STYLE = BOLD, $ TYPE = SUBFOOT, ITEM=1, COLSPAN = 5, $ ENDSTYLE END
The output shows that the first item in the sort footing (the text Total) is in the fifth column of the report output. The second item in the sort footing (the field <ST.QUANTITY) is positioned in the next available column.