Using the HEADER of a frame for running page heads
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
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
following code fragment 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 ABL. For more information, see ABL Reference. 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:
- A
HEADERsection can contain expressions. - ABL re-evaluates expressions in a
HEADERsection each time the frame is redisplayed. - ABL suppresses field and variable labels in a header frame. If you want labels, you supply text strings in the frame definition.
If a HEADER frame contains an expression, field,
or variable, the frame definition must take place in the context
where ABL 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:
|
The following 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-SIZEoption of theOUTPUTstatement sets the default size for a report page. - The
HEADERoption tells the AVM to place the specified items in the header section at the top of the frame. - The
TODAYfunction returns the current system date, and constitutes an expression. - The
SalesRepinitials come from the database and represent another part of theHEADERthat the AVM must evaluate. - The
PAGE-NUMBERfunction tracks the current page number (expression). - The
PAGE-TOP FRAME f-hdrfurther defines what kind ofHEADERthe frame is.PAGE-TOPspecifies where to place the frame and makes the frame a running page head.