Word
Create Word report templates with merge fields for generating formatted documents.
Word (.docx) templates generate one formatted document per submission. They are the recommended format for detailed per-submission reports such as inspection reports, delivery notes, or certificates.
Overview
Format
.docx (Word 2007 or higher)
Report engine
Aspose Library for Word
Best for
Per-submission documents with rich formatting, images, signatures, conditional sections
Listing mode
Supported via Repeat() — produces one document covering multiple submissions
Field syntax basics
Insert a field by wrapping its system name in <% and %>:
<%SystemName%>System names are case sensitive.
Any font formatting applied in Word (bold, italic, colour) carries through to the generated output. For example, <%FirstName%> renders the value in bold.
Rich text fields
If a Text field uses the "Rich Text" option, use <%MarkDown(SystemName)%> to preserve the layout in the generated document.
Conditional values
Use If() to display different text based on a field value — useful for Boolean fields, which return True or False by default:
<%If(FieldName == 'Value', 'Result if true', 'Result if false')%>Example template

Generated report

For the full list of available functions (images, maps, aggregations, conditional blocks, etc.), see Syntax & Functions.
Relationships
The template is based on the main form but can include data from directly related child forms. To display a relationship, place the Relation() instruction in the first (leftmost) cell of a table row:

The row repeats once for each child submission. Reference child form fields by their system names in the remaining cells:
Tips
Apply formatting directly to the tag —
<%FieldName%>renders the value in bold.Use
List()to build a formatted address from separate fields:<%List(', ', Street, PostalCode, City)%>— empty fields are skipped.Use
Exists()to guard optional image fields:<%If(Exists('Photo#1'), Image([Photo#1], 200), '')%>Apostrophes in function arguments must be straight single quotes
'. Replace smart quotes if you copy from another source.
Limitations
Format:
.docxonly.MarkDown()works in Word only — not in Excel or PowerPoint reports.The "Relationship element" field type is not persistent and cannot be used in a report.
Last updated
Was this helpful?

