Search Locate Previous Next Contents

Fixed Text

This object is used to add fixed text to appear on every page of output. It would normally be added to the layout as a simple horizontal line (the baseline for the text), however if you draw out a rectangle the text will be written along the diagonal of the rectangle you draw, with no clipping or wrapping. The baseline (or diagonal) is extended as necessary.

The default diagonal (for rotated text) runs from top left to bottom right of the containing rectangle; you can select any of the four alternative diagonal directions with the ‘Direction’ property. Most of these work best if you also centre the text with the ‘attach to width’ button.

If you need to wrap horizontal text into a given rectangle, use the Wrapping Text object instead.

Properties

Colour ... (from leaf.‘colours)
Font ... (from the current font list)
Size ... font size in points
Direction ... selected diagonal for angled text

Substitution parameters
You can substitute up to 9 parameters (marked with %1 to %9 as in DOS batch files), the current page number (&p), the total number of pages (&n), or the date and time of printing (&d &t). If the parameters are all known when you begin the report, simply give them as the left arguments to leaf.Use, for example to have %1 replaced by your current file name:

‘file leaf.Use rpt_name

To substitute parameters ‘in flight’, for example to thumb-index a workspace listing with the function name that starts the page:

1 leaf.Subst fname

Note that this must also be passed to leaf.Use for the very first page as the fixed text is defined when the layout is opened, i.e. before the first call to leaf.Place or leaf.Flow.

Customising the page numbers
NewLeaf can automatically number pages for you, starting from 1 by default. The NewLeaf text object can be captioned with any simple string of text such as:

Page &p of &n
Section 1.3.&p
(&r)

The current page will be substituted for the &p placeholder, or you can use Roman numbers with &r. To set the page counter to a specific value:

leaf.Set 'currentpage' n

Adding date and time
Many organisations routinely add “date and time of printing” to all official documents. The NewLeaf text object can be captioned with any simple string of text such as:

Printed on &d at &t

The current date (in the Windows short-date format) will be substituted for the &d placeholder, and the current time (in 24hr format) will replace the &t marker.



Continue to: Wrapping Text
© Copyright Causeway Graphical Systems Ltd 2003