HEADING

HEADING, HEADER

Top  Previous  Next

 

The HEADING keyword defines a page heading for the report. The synonym HEADER may be used.

 

 

Format

 

HEADING "text"

 

where

 

textis the heading text to appear on each page.

 

 

A page heading defined with the HEADING keyword will appear at the top of each page of the report in place of the default heading. Except when used with the SHOW verb, the heading text may contain control codes enclosed in single quotes to insert variable data or to alter the appearance of the heading. These control codes are:

 

B{n}Insert data from the corresponding B control code in a BREAK.ON or BREAK.SUP option string. The optional single digit qualifier, n, defaults to zero if omitted.
CCentres the current line of the heading text.
DInserts the date. The default format is dd mmm yyyy (e.g. 24 Aug 2005) but can be changed using the DATE.FORMAT command.
F{n}Inserts the file name in a field of n spaces. If n is omitted, a variable width is used.        
GInserts a gap. Spaces are inserted in place of the G control code to expand the text to the width of the output device. If more than one G control code appears in a single line, spaces are distributed as evenly as possible.

When a heading line uses both G and C, the heading is considered as a number of elements separated by the G control options. The element that contains the C option will be centered. The items either side of the centered element are processed separately when calculating the number of spaces to be substituted for each G option.

HnSets horizontal position (column) numbered from one. Use of H with C or with a preceding G token may have undesired results.
I{n}Inserts the record id in a field of n spaces. If n is omitted, a variable width is used.        
LInserts a new line at this point in the text.
NSuppresses pagination of the output to the display.
OReverses the elements separated by G tokens in the current line on even numbered pages. This is of use when printing double sided reports.
P{n}Insert page number. The page number is right justified in n spaces, widening the field if necessary. If omitted, n defaults to four.
R{n}Same as I{n}.
S{n}Insert page number. The page number is left justified in n spaces, widening the field if necessary. If omitted, n defaults to one.
TInserts the time and date in the form hh:mm:ss  dd mmm yyyy. The format of the date component can be changed using the DATE.FORMAT command.

 

A single quote may be inserted in the heading by use of two adjacent single quotes in the text.

 

If more than one HEADING definition is given in a single query, the first one is used. This allows a query sentence to include a heading that will override an alternative heading in the default listing phrase.

 

 

Example

 

The command

 

LIST SALES HEADING "'C'SALES REPORT'LDG'Confidential" HDR.SUP

 

might produce a report such as that below.

 

                     SALES REPORT

26 Jun 2000                                      Confidential

SALES..... REGION  SALESMAN  ORDER VALUE

19845       North   Harris         234.53

19858       North   Sharp          845.50

19859       North   Sharp          384.43

19887       North   Roberts        279.40

19830       South   Smith          324.39

19886       South   Abbott         397.23

19866       South   Abbott         465.31

 

7 records listed.

 

 

See also:

FOOTING