Progress
Language Tutorial
for Windows
Using the HEADER of a Frame for Running Page Heads
A frame can contain three distinct sections: body, HEADER, and BACKGROUND. Until now, everything you placed in a frame became part of the frame body. Using the keywords HEADER and BACKGROUND, you can also define two additional sections for your frames. The code fragment below shows how a DEFINE FRAME statement with these sections would look:
Frame backgrounds are typically used for placing a logo (image) or other graphic device in the background of a display frame. However, you cannot print graphics from the Progress 4GL. For more information, see the Progress Language Reference and the Progress Report Builder User’s Guide . The rest of this section concentrates on the HEADER part of the frame.
The HEADER has a couple of special properties that allow you to implement running page heads and footers:
If a HEADER frame contains an expression, field, or variable, the frame definition must take place in the context where Progress can provide new values. In other words, for an iterating report procedure, move the DEFINE FRAME statement from the top of your procedure into the FOR EACH block. Think of a HEADER frame as an executable statement. Just like a DISPLAY statement inside a FOR EACH block, the HEADER section of the DEFINE FRAME statement executes on every iteration of the FOR EACH block.
Also, note that a frame does not have to have a body—it can consist of a header only. You can modularize your report design with three frames: one each for page header, body, and page footer. This approach lets you adopt standard headers and footers.
Assume that All Around Sports wants a standard page header on every page of its reports. This is the information they want to include in the page header:
This code defines the first part of a procedure that implements the three-frame design:
This part of the procedure contains the following language elements and points of interest:
- The PAGE-SIZE option of the OUTPUT statement sets the default size for a report page.
- The HEADER option tells Progress to place the specified items in the header section at the top of the frame.
- The TODAY function returns the current system date, and constitutes an expression.
- The Sales-rep initials come from the database and represent another part of the HEADER that Progress must evaluate.
- The PAGE-NUMBER function tracks the current page number (expression).
- The PAGE-TOP FRAME f-hdr further defines what kind of HEADER the frame is. PAGE-TOP specifies where to place the frame and makes the frame a running page head.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |