STARTHEADING
Starts the definition of the page heading in place of the default heading, which is displayed at the top of each page in the report or immediately following a HEADING command.
Syntax
{ STARTHEADING }
Notes
-
This command starts the definition of the page heading in place of the default heading, which is displayed at the top of each page in the report or immediately following a HEADING command. The ENDHEADING command signifies the end of the heading; all commands encountered between the STARTHEADING and ENDHEADING are part of the heading definition. Unless SUPHEADING is used outside the STARTHEADING / ENDHEADING group, the commands within the STARTHEADING/ENDHEADING group are re-executed at the start of each new page.
-
By default, new pages are started whenever a page member changes, the makeup of column headings change, the page length is exceeded and SUPFEED has not been used, the NEWPAGE command is issued, the HEADING command is issued, or the PAGEONDIMENSION command causes a page break. A custom heading will include the default page header and column headers unless they are suppressed with SUPPAGEHEADING and/or SUPCOLHEADING in the custom heading definition.
-
Headings (whether the default page and column headings or a custom heading created with ENDHEADING) do not get output right at the start of a new page. They are delayed until the next non-suppressed output data row is encountered, and even then the heading is output only after the data row's format { } commands have been processed. This avoids blank pages with nothing but headers on them but it can make it awkward to put out a TEXT (or other format which produces output) between the heading and the first output data row.
-
To use a subsitution variable in a heading, you must use the TEXT command. Example:
{STARTHEADING TEXT 2 "Prepared by:" 14 "*USERNAME" C "The Electronics Club" 60 "*PAGESTRING" TEXT C "Quarterly Sales by City" 60 "*DATE" SUPPAGEHEADING Text 2 &Month TEXT 2 "*PAGEHDR" SKIP ENDHEADING} !
Tip:
To ensure that headings display correctly, structure the report script so that column member selections precede row member selections, and make sure that the script contains at least one column member.
Default Value
Replaces default heading.
Example
The following example shows how to define a heading for a report. All the commands within the STARTHEADING and ENDHEADING commands are executed at the top of each page. The TEXT commands display information about the person who prepared the report, the date the report was generated, and other title information.
<PAGE (Market, Accounts, Scenario)
Chicago Sales Actual
<COLUMN (Year)
<CHILDREN Year
<ROW (Product)
{ STARTHEADING TEXT 2 "Prepared by:" 14 "*USERNAME"
C "The Electronics Club" 60 "*PAGESTRING"
TEXT C "Quarterly Sales by City" 60 "*DATE"
SUPPAGEHEADING
TEXT 2 "*PAGEHDR" SKIP ENDHEADING}
<IDESCENDANTS Product
!
This example produces the following report:
Prepared by:ksmith The Electronics Club Page: 1
Quarterly Sales by City 06/10/20
Chicago Sales Actual
Qtr1 Qtr2 Qtr3 Qtr4
======== ======== ======== ========
Stereo 2,591 2,476 2,567 3,035
Compact_Disc 3,150 3,021 3,032 3,974
Audio 5,741 5,497 5,599 7,009
Television 4,410 4,001 4,934 6,261
VCR 3,879 3,579 4,276 4,877
Camera 2,506 2,522 2,602 3,227
Visual 10,795 10,102 11,812 14,365
Product 16,536 15,599 17,411 21,374