Page Backgrounds and Foregrounds

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Page Backgrounds and Foregrounds

History:

Starting with the version 9.32, page backgrounds are available on every pages.

The version 10.10 has enabled multiple backgrounds.

The version 10.24 has extended the concept to foreground pages. They are printed after all backgrounds and page objects have been processed.

 

 

This approach has the following benefits:

oCode simplification,

oLess memory is used, so larger files can be processed,

oFaster rendering, these pages are built only one time and not on each page.

 

 

How does it works?

 

The start of a background or foregound setup is defined by the tag:

<BACKGROUND>

<FOREGROUND>

defines the default background

or foreground

-OR-


<BACKGROUND#name>

<FOREGROUND#name>

defines a named background/foreground.

about_24_h name should not contain + or - characters

 

When a background or a foreground is active, all tags, images and texts are diverted to the current area until a </BACKGROUND> or </FOREGROUND> is encountered.

 

 

Any tag, image or text can be inserted anywhere in the page, to build the background/foreground area of the report.

about_24_h Exception: avoid and pages bookmarks (preprocessed tags) like , they are calculated within the area and not on each page.

about_24_h Do not insert form-feeds ("PAGE"), backgrounds or foregrounds are "one-page" only.

about_24_h The default background or foreground defined with a basic <BACKGROUND> or <FOREGROUND> have the internal name of "0".

 

 

... and closed by:

 

</BACKGROUND>

</FOREGROUND>

 

After these tags, font, colors and position within the page are reset to the values that they had before the <BACKGROUND> or <FOREGROUND> instruction.

 

 

about_24_h When a background or a foreground tag is defined without name, all pages following the background or foreground definition will automatically use this default background/foreground unless if a </BG> or </FG> tag is encountered.

 

Display/hide backgrounds and foregrounds:

A background can be activated or deactivated with the or tags.

The </BG> tag stops the background starting at the current page.

To use the default background again, use <BG> (or <BG=0>).

 

A foreground can be activated or deactivated with the or tags.

The </FG> tag stops the foreground starting at the current page.

To use the default foreground again, use <FG> (or <FG=0>).

 

Non-printable non-exportable backgrounds: (version 10.28)

about_24_h <BACKGROUND [#name] =[!PRINT] , [!EXPORT]

By default, backgrounds are displayed, printed and exported.

 

A background is always displayed but it's possible to disable the printing or the export with the options !PRINT and/or !EXPORT

This applies to each background, individually.

 

That does not apply to foregrounds, they are always printed and exported.

 

Default background basic example:

 

<BACKGROUND><R65><C60><#IMG><R+2><C+20><IMAGE#IMG=C:/4GL/4GL.bmp><=IMG><FArial><P18> Accounting</BACKGROUND>

In the following example, the background includes the logo and the two banners with "Background illustration" inside (example from the demo program).

 

background_example

 

Multiple backgrounds and foregrounds:

 

Several named backgrounds and foregrounds can be defined with the <BACKGROUND#name> or <FOREGROUND#name> instructions.

 

The <BG> or <FG> tag activate or deactivate the use of the back and foregrounds on the different pages.

Once a <BG>, <FG>, </BG> or </FG> tag is encountered, the use of the specified backgrounds starts at the current and following pages until a new <BG>/<FG>.

 

Syntax:

<BG=0,top,bottom>

displays the default background and the backgrounds "top" and "bottom".

<BG=+top-bottom>

adds the background "top" and deletes the background "bottom" from the current background.

</BG>

hides all backgrounds from the current and the following pages

<BG> or <BG=0>

displays the default background (defined by a <BACKGROUND>).