INITIAL HEADING
Sets the content and format of the heading at the beginning of the report.
Syntax
INITIAL HEADING [ALIGN|NOALIGN] [report-group]
ALIGN|NOALIGN
ALIGN aligns the items in the INITIAL HEADING statement with the same items in the REPORT statement. If there is an obstacle in the way, such as a label or an item positioned with the TAB option, then the ALIGN option puts the item to the right of the obstacle. Similarly, items in the heading that aren't in the REPORT statement are put to the right of previous items, overflowing onto a new line if necessary.
NOALIGN does not align items. The NOALIGN option overrides SET REPORT ALIGN.
Default: NOALIGN
report-group
Establishes the report-group to be printed at the beginning of the report. If no report-group is included, any previous INITIAL HEADING statement is canceled.
For more information about report-groups, see(p. 109).
Discussion
The INITIAL HEADING statement prints a one-time heading that appears on the first page of the report. When an initial heading appears on a page, any page heading is omitted for that page. If you use the NOREPORT statement, then the initial heading is not displayed if no records are reported.
To create a separate title page, simply add the SKIP PAGE option to the end of the initial heading report-group.
A SKIP option at the beginning of the INITIAL HEADING statement’s report-group is ignored. To skip lines before printing the initial heading, print a space before skipping. For example:
> INITIAL HEADING " " SKIP
Chapter 3: QUIZ Statements INITIAL HEADING
Example
This report uses INITIAL HEADING to print a title for the report. In this example, INITIAL HEADING creates a title for the first page of the report. The first line of a report must be a default heading or a report-item; an initial SKIP is ignored as an initial heading. In this example, a skip is forced by inserting a blank report-item before the SKIP option.
> ACCESS CUSTOMERS &
> LINK TO ORDERMASTER &
> LINK TO ORDERDETAIL
>
> DEFINE TITLE CHARACTER * 45 &
> = SPREAD("Overall Orders Report")
>
> SORT &
> ON PARTNUMBER &
> ON CUSTOMERNAME
>
> INITIAL HEADING " " &
> SKIP 1 &
> TITLE &
> SKIP 1
>
> HEADING AT PARTNUMBER &
> SKIP 2 &
> "Part Number: " &
> PARTNUMBER SKIP &
> "---"
>
> FOOTING AT CUSTOMERNAME &
> "Orders for: " &
> CUSTOMERNAME TAB 40 QUANTITYORDERED SUBTOTAL
>
> FOOTING AT PARTNUMBER &
> SKIP &
> "---" &
> SKIP &
> "Total Sales for Part: " &
> PARTNUMBER TAB 40 QUANTITYORDERED SUBTOTAL
>
> FINAL FOOTING &
> SKIP 2 &
> "Total Sales: " &
> TAB 40 QUANTITYORDERED SUBTOTAL &
> "Units"
>
> GO
INITIAL HEADING
Without the ALIGN Option
In this example, the "These are the billings for Project" label is aligned to the left-hand side of the report and the project number follows. The default is NOALIGN.
> ACCESS BILLINGS
> SORT ON PROJECT ON EMPLOYEE
> CHOOSE PROJECT PARM PROMPT &
> "ENTER PROJECT NUMBER REQUIRED " 1 TIMES
> REPORT TAB 20 BILLING EMPLOYEE PROJECT &
> PRINT AT PROJECT
> INITIAL HEADING &
> SKIP PAGE " " SKIP 3 &
> "These are the billings for Project " &
> PROJECT &
> TAB 60 "DATE" SYSDATE SKIP 3
> FINAL FOOTING ALIGN SKIP 2 &
> "TOTAL BILLINGS FOR THIS PROJECT:" &
> SKIP 1 &
> BILLING SUBTOTAL PICTURE "^^^,^^^,^^^.^^" &
> PROJECT
> GO
Chapter 3: QUIZ Statements INITIAL HEADING
With the ALIGN Option
In this example, the labels are aligned to the left-hand side of the report and the project is aligned with the project in the REPORT statement.
> ACCESS BILLINGS
> SORT ON PROJECT ON EMPLOYEE
> CHOOSE PROJECT PARM PROMPT &
> "ENTER PROJECT NUMBER REQUIRED " 1 TIMES
> REPORT TAB 20 BILLING EMPLOYEE PROJECT &
> PRINT AT PROJECT
> INITIAL HEADING ALIGN &
> SKIP PAGE " " SKIP 3 &
> "These are the billings for Project " &
> PROJECT &
> TAB 60 "DATE" SYSDATE SKIP 3
> FINAL FOOTING ALIGN SKIP 2 &
> "TOTAL BILLINGS FOR THIS PROJECT:" &
> SKIP 1 &
> BILLING SUBTOTAL PICTURE "^^^,^^^,^^^.^^" &
> PROJECT
> GO
Aligning Summary Operations
In this example, the BILLING SUBTOTAL on the heading aligns with the BILLING SUBTOTAL in the REPORT statement.
> ACCESS BILLINGS
> REPORT BILLING BILLING SUBTOTAL
> INITIAL HEADING ALIGN BILLING SUBTOTAL
In the following example, there is no matching summary operation and item in the REPORT statement. Therefore, the BILLINGS MAXIMUM on the heading aligns with the BILLINGS item in the REPORT statement.
> ACCESS BILLINGS
> REPORT BILLING BILLINGS SUBTOTAL
> INITIAL HEADING ALIGN BILLING MAXIMUM
In the next example, the two BILLING items will not align because BILLING SUBTOTAL on the heading is aligned with BILLING SUBTOTAL in the REPORT statement. The print position for the BILLING item of the heading is already positioned past the BILLING item in the REPORT statement.
> ACCESS BILLINGS
> REPORT BILLING BILLING SUBTOTAL
> INITIAL HEADING ALIGN BILLING SUBTOTAL BILLING
NOREPORT
NOREPORT
Specifies what to print if no record complexes are selected.
Syntax
NOREPORT [report-group]