Print objects are links between the Procedure, that defines the logic of the report, and Print Templates, that define the form of the report.
Upon introducing a Print object from the Palette to the Workspace, the object is empty. It is set to the specific Print template in the course of constructing the Procedure by selecting the desired Print Templates from the Palette and loading it into the object (drag-drop or double click the Print Template Name). The Print object represents instructions to print the contents of the variables in the Procedure according to the form laid out by the Print templates.
When the Print object has been assigned a Print template, the Inspector view displays two columns:
When the variable names or database fields of the Procedure match the field names of the Print template, the mapping process is automatic upon clicking on the Check syntax button (provided no errors are encountered before reaching the Print object in the flow of execution) or upon attempting to Save. In the event that matches are not found, the resolution must be achieved manually by dragging the appropriate variable on top of the ghosted field name e.g. assume one of the template fields to be a field called "Prefix name"; if the Procedure variable is also called "Prefix name", then automatic mapping of this field is possible; if the Procedure variable is called "Prefix Description", then manual drag-drop mapping is required (from the Local area of the Palette).
The Life Cycle of Print Templates
When the Report Procedure runs, it may call a given Print Template more than once, especially if it prints a set of similarly laid-out lines in a loop e.g. sales invoices, ledgers, name and address lists, etc.
Templates remain active until...
When the Print Template is called by the Procedure for the first time, it becomes active and continues to be active until the Procedure in which the Template is used exits, or until the Procedure explicitly stops it with the Print Terminator.
While active, the Template "watches" the progress of the report, as it fills the currently printed page and utilizes Header, Body, and Footer segments:
Subsequent calls to the same Template do not trigger printing of the Header. Instead, printing of the Header and Footer is governed by the following conditions, which are defined for a given Template with the Print Template Inspector:
A Header may be printed on the top of each page or only once:
A Footer may be printed at the end of each page, or only once, when the Template's life cycle comes to its end - either through the Print Terminator, or by exiting the Procedure. Exactly how the Footer is printed is controlled by radio buttons in the Segment Inspector view:
Competition between Templates...
More than one Print Template may be active at any given time. If multiple Templates compete with one another for printing of Headers and Footers, the conflicts are resolved on the priority basis:
However, STEP FORWARD makes sure that Headers and Footers of all active Templates are printed on the same page, provided that the combined height of all Headers and Footers fits on to one page.
Forcing Page Breaks
It is possible to force a page break when the Print template begins its life (i.e. is called first time). This is controlled by setting Always start on the new page radio button ON in the Template Inspector view . This option can be used by those templates that provide page-wide layouts, such as Header and/or Footer calling for the printing of page number, date and time of printing, column headings, etc.
Table of Contents