# Word

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%>
```

{% hint style="warning" %}
System names are case sensitive.
{% endhint %}

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**

![](/files/wrH3npWrKPlE5LmdkcZN)

**Generated report**

![](/files/TGwVoiUiYcCmVKU9u3lS)

For the full list of available functions (images, maps, aggregations, conditional blocks, etc.), see [Syntax & Functions](/user-documentation/build/building-the-reporting/syntax-functions.md).

## 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:

```
<%Relation('Relationship field label')%>
```

![](/files/CCWq2pVe7k7NcEJdZPfj)

The row repeats once for each child submission. Reference child form fields by their system names in the remaining cells:

```
<%childFieldSystemName%>
```

## 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: `.docx` only.
* `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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.center.daxium-air.com/user-documentation/build/building-the-reporting/report-templates/word.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
