> For the complete documentation index, see [llms.txt](https://help.tillit.cloud/tillit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.tillit.cloud/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates.md).

# Report Templates

## Overview

A Report Template generates PDF (and HTML) reports from data in TilliT—from an order, a shift, or one or more boards. Common uses include an end-of-order report for auditing, a certificate of analysis, an end-of-shift compliance report, or a scheduled summary pulled from board records.

A Report Template can also incorporate images from submitted activities and lets you format the report layout to your liking.

Building a Report Template is a two-step process:

1. Filter the data the report should draw on — which activities, order attributes, or boards to read from.
2. Build an HTML template that formats the final PDF — add your company logo, fonts, and colours.

This guide covers creating and managing Report Templates, and how each of the three data types — ORDER, SHIFT, and BOARD — is used.

## **Navigation**

Navigate to ***Settings > Configuration > Report Template*** to open the configuration page.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2F1RIQBlL5mf65Vf0KGdv9%2Fimg.png?alt=media&amp;token=73fcf5a7-99dd-4214-ad23-f60e3edb3159" alt=""><figcaption></figcaption></figure>

## Creating a Report Template

{% stepper %}
{% step %}
Click **Create**.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2FTHhbFTR1E4Vypzz3M0Hp%2Fimage.png?alt=media&amp;token=007b4d79-540a-4b7e-9494-0b877871b4f1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
On the creation modal, configure the basic information:

* **Name:** The name of the report.
* **Description:** A description of the report.
* **Data type:** Determines what the report draws data from ([`ORDER`](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/order-and-shift-reports.md), [`SHIFT`](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/order-and-shift-reports.md), or [`BOARD`](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/board-reports.md)).

And Continue.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2FriqJT1AG0KhcLNvw9rlI%2Fimage.png?alt=media&amp;token=aba2327a-4fac-4247-8b73-a442b05d8e09" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
The modal that will appear differentiates according to the Data Type selected in the previous step. Fill in the data to include based on your chosen type.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2F5XjGWR2ceRTvSLkblo6t%2Fimg.png?alt=media&amp;token=ce2eeebb-ed9f-4dd1-8a99-92d6c41499eb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Create a new HTML template or use an existing one. Choose Blank for a completely empty template. If you don't have HTML or handlebars scripting experience, use one of the Starter Templates—it matches the Data type you selected.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2Fbi3mtFCwU6PIvARx1m05%2Fimage.png?alt=media&amp;token=c8b78a8e-c446-4610-9e8e-7e26ec1771f0" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="info" %}
Next Steps: Managing and Generating Reports Once the basic template is created, the specific configurations, activity filtering, and generation process depend on the data type you selected. Choose your report type below to see detailed instructions:

* [**Order Reports**](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/order-and-shift-reports.md)**:** Learn how to filter specific activities and generate reports from a single order.
* [**Shift Reports**](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/order-and-shift-reports.md)**:** See how to scope data to a shift instance and generate reports.
* [**Board Reports**](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/board-reports.md)**:** Configure board data limits, date ranges, and generate ad-hoc reports from reference data.
  {% endhint %}

### Fields

<table><thead><tr><th width="209">Name</th><th>Desc</th></tr></thead><tbody><tr><td>Name</td><td>The name of the report.</td></tr><tr><td>Description</td><td>A description of the report.</td></tr><tr><td>Data type</td><td>ORDER, SHIFT, or BOARD — determines what the report draws data from. See <a href="/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/order-and-shift-reports.md">Order Reports</a>, <a href="/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/order-and-shift-reports.md">Shift Reports</a>, and <a href="/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/board-reports.md">Board Reports</a>.</td></tr><tr><td>Asset Classes</td><td>Which asset classes are included in the report. Not shown for BOARD type templates.</td></tr><tr><td>HTML Template</td><td>Create a new HTML template or use an existing one. Options are Blank, Order Starter Template, or Shift Starter Template.<br>Choose Blank for a completely empty template.<br>If you don't have HTML or handlebars scripting experience, use one of the Starter Templates — it matches the Data type you selected.</td></tr><tr><td>Attributes</td><td>Which attributes are included in the report. Not shown for BOARD type templates.</td></tr><tr><td>Activities</td><td>Which activities are included in the report. Not shown for BOARD type templates.</td></tr><tr><td>Operations</td><td>Which order template operations are included in the report, as a comma-separated list. Not shown for BOARD type templates.</td></tr><tr><td>Include Images</td><td>Whether to include activity images in the report. Not shown for BOARD type templates.</td></tr><tr><td>Sort By</td><td>Sorts the Activities in the report by Completed At date or Issued At date. Not shown for BOARD type templates — board sorting is configured per board, see <a href="/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/board-reports.md">Configuring board data</a>.</td></tr><tr><td>Sort Direction</td><td>Sort direction for the chosen Sort By field.</td></tr></tbody></table>

## Building the HTML Template

Use the HTML editor to design and lay out your report. TilliT uses the Mustache templating engine, which inserts data dynamically using curly braces, for example `{{order.order_number}}`.

{% hint style="warning" %}
**Shared Templates:** If an HTML Template is used by more than one Report Template, editing it displays a warning listing the other Report Templates that share it. Review the list before saving to avoid unintended changes to other reports.
{% endhint %}

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2FqdGbk2SLdCjniRGHI4n7%2Fimage.png?alt=media&amp;token=b45eec88-2ede-4ed5-b3db-e124cdba82e1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2Fgit-blob-d7449f67d0e14158d581e00c3cd0e29a8daaab3a%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Referencing activity items values**

To reference an activity item's value, use:

```handlebars
<td>
  {{#if this.stringValue}}
    {{this.stringValue}}
  {{else if this.numericValue}}
    {{this.numericValue}}
  {{else if this.booleanValue}}
    {{this.booleanValue}}
  {{else}}
    {{this.value}}
  {{/if}}
</td>
```

Referencing `this.value` alone displays the item's raw value, which might not be nicely formatted.
{% endhint %}

## Previewing Your Template

Use the Preview Panel to see what your template will render. It has three views:

* **Preview HTML** shows what the HTML in the editor renders as, in a single scrolling page.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2Ffh0HoLdU0qB0yB9KjYBF%2Fimage.png?alt=media&amp;token=dba4b07b-9423-41cb-bdb7-8afa7c89dcc3" alt=""><figcaption></figcaption></figure>

* **Preview PDF** renders a PDF formatted with your HTML, which can be saved and viewed like any other PDF.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2Fkd4WPaHVdOQIQ5fsJ2kb%2Fimage.png?alt=media&amp;token=3920ba62-aab6-4db1-ad4e-1da867aac21d" alt=""><figcaption></figcaption></figure>

* **Order Data** shows the data available — from the chosen preview order plus the assets, attributes, and activities you selected earlier — so you can work out how to reference it in your data insertion.

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2FPPySofc4dWfazauOCNU2%2Fimage.png?alt=media&amp;token=5bd7103a-fee1-49db-8029-20d76fb19ebc" alt=""><figcaption></figcaption></figure>

For SHIFT type templates, the preview panel shows an **Asset** and **Shift Instance** selector instead of an order, and the data view is labelled **Report Data** instead of **Order Data**. Board reports use their own preview flow — see [Previewing a board report](/tillit/knowledge-base/setting-up-tillit/configuration/creating-and-using-report-templates/board-reports.md#previewing-a-board-report).

<figure><img src="https://352909507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrNT40XJFAFlAhUX8CcQS%2Fuploads%2Fgit-blob-eaceef15e59abb2184d3e3a9c72ab8c06b7da9db%2Freport-templates-shift-type-preview.png?alt=media" alt=""><figcaption><p>Preview for a SHIFT type report template</p></figcaption></figure>
