Was this helpful?
.Header Statement--Begin Formatting Statements for the Header
The .header statement identifies the start of a block of text formatting statements that define the action to be taken at the start of a break in the report.
When you create a report header, put the .header report statement and the formatting statements associated with it before any other .header statements. Report-Writer considers all statements between one .header statement and any subsequent .header, .footer, or .detail statement as part of the first header action.
This statement has the following format:
.header | .heading | .head
    report | page | columnname
The parameters for the .header statement are as follows:
report
Prints the header before the start of the report.
page
Prints the header at the top of all pages except the first page.
columnname
A break column name specified in the .sort or .break statements. Specify the column name as a delimited identifier by enclosing it in double quotes ("), if you have previously specified the .delimid statement.
The columnname can be expressed as a variable.
Prints the header before a new value of a break column.
$columnvariable
Variable whose value is a name of a column specified in a .sort or .break statement. Precede the variable must with a dollar sign ($).
If you specify a variable for columnname, Report-Writer evaluates the variable during the loading of the report specification, before retrieving any data.
Note:  When using a variable for columnname, specify the same variable identically in corresponding .break, .sort, and .footer statements.
Examples
1. Specify a page header.
.header page
        .tab 10
        .print 'Accounts Receivable Aging
           Report by Client'
        .newline
2. Specify a report header that prints the current date, the current time and the name of the report at the start of the report.
.header report
        .leftmargin 10
        .rightmargin 70
        .left
        .print current_date
        .right
        .print current_time
        .newline 2
        .underline
        .center
        .print 'Annual Costs'
        .nounderline
        .newline
3. Specify a break header for the column "last name."
.delimid
.query
    select "last name", "first name"
        from names_tbl
.sort "last name"
.header "last name"
    .newpage
Last modified date: 08/28/2024