Search Locate Previous Next Contents

Structuring an Initialisation Routine

The aim of writing a custom initialisation routine is to gather together in one place as many of the non-standard text and table property settings as possible, especially where these are the same for several different reports in an application. In most cases, it will also be necessary to fine-tune some of these for individual reports. Assuming that the required objects are in the workspace, one possible framework for a report module could look like this:

  1. General initialisation, including the custom NewLeaf initialisation routine described below.
  2. Report-specific initialisation, including any special NewLeaf property values for this report.
  3. Start the report with nlUse and the page layout(s) for this report.
  4. Run the report (nlFlow, nlPlace, nltList, nltSpread ...).
  5. Stop the report (nlClose or nlSpool).
  6. Tidy-up and exit.

The customised NewLeaf initialisation procedure allows you to accommodate “house” styles, such as non-standard paper sizes or a requirement that all reports be printed in 10-point Times or Helvetica. This function also has a simple structure:

  1. Run nlInit to set default properties and create working copies of variables.
  2. Add information about custom papers to nl‘papers.
  3. Run nlDefineFont to add custom font mappings.
  4. Run nlDefineStyle to add custom text styles.
  5. Run nlSet ... to set the default values for text properties such as font, indents, etc.
  6. Run nltSet ... to set the default values for table or column header properties such as font, alignment, etc.


Continue to: Adding Extra Paper Sizes
© Copyright Causeway Graphical Systems Ltd 2001