Using sub-templates is a powerful feature to reuse text parts such as consistent page headers and footers, terms of business or address areas. Those parts can be modified separately without changing them in each and every template. During the merge process, the sub-templates are evaluated separately and inserted into the currently merged template.

Using sub-templates in Text Control Reporting

In Text Control, those sub-templates can contain all elements such as merge fields, repeating blocks or sub-templates itself (don't panic, Text Control takes care of potential endless loops).

This tutorial shows how to insert a page header using sub-templates.

  1. Open the shipped template designer TX Text Control Words.

    Start a design for a header with typical elements that should be displayed in your page header including a company logo and the address details.

    Important: Create the header design in the main text of the document, not in the header:

    Using sub-templates in Text Control Reporting
  2. Save this document and name the file header.docx.

  3. Create a new document and choose Edit Header from the Header drop-down button:

    Using sub-templates in Text Control Reporting
  4. From the Insert Special Field drop-down button, insert an IncludeText field.

    Using sub-templates in Text Control Reporting

    In the opened dialog box, type in the name of the header file created in step 2.

    Using sub-templates in Text Control Reporting
  5. From the Select Data Source drop-down button, select Load Sample Database and choose Preview Merge Fields.

    Using sub-templates in Text Control Reporting

If you modify the header.docx template, these changes are applied to all templates where this header is included.

You can download both templates here.