pagestyle

The pagestyle function inserts a section break and applies the page settings from the specified page style document.

 @(pagestyle (brand; document type))

The result of the function pagestyle is of type TEXT.

This function affects only the Word styling. To control the styling of all supported output formats, use the DOCUMENTSTYLE statement.

This function has two parameters:

  1. brand, type TEXT: The name of the Brand directory from where the page style should be taken from. An empty string maps to the No Brand folder.
  2. document type, type TEXT: The name of the Document Type directory from where the page style should be taken from. An empty string maps to the styles defined directly in the indicated Brand folder.

In combination, these two parameters identify a folder in KCM Designer. The "Word Page Style" document in this folder defines the page style. As a result, the page settings of the first page of this document will be applied.

The result of the pagestyle function must be put into the result document to have an effect.

The first time the pagestyle function is applied to a result document, it does not insert a section break. This gives the script developer the ability to use this function to set the page style for the initial section of the document. Any subsequent applications automatically insert a new section break. If the function pagestyle is applied for the first time after producing some initial pages, the script developer is responsible for inserting a section break manually immediately followed by the function pagestyle.

The attributes of the section break are derived from the first section of the template document. Headers and footers are not copied from the template document but inherited from the previous section (if any) of the result document. The functions headers and footers can be used to make changes to the section.

The function pagestyle also sets the "different odd and even" setting in the result document. If any of the template documents has this option enabled, it is also enabled in the result document. If none of the template documents has this option enabled, it is disabled in the result document. This feature can be disabled with the pragma function (see pragma).

You cannot use the pagestyle function to introduce a section break within a table in the result document. This results in a run-time error. If the new section must begin with a table, the function pagestyle must be called before the table is created.

An example is provided here.

# BEGIN

#
@(pagestyle ("Insurance For Life"; "Invoice"))
#

#
@(pagestyle ("Insurance For Life"; "Policy"))
#

END #