---
title: "Create a template report"
site: admin
version: 1.11
versions: "all"
url: https://docs-new.servicely.ai/admin/1.11/reporting/template-reports/
type: task
application: platform
last_updated: 2026-10-18
commit: 50111ae9bd3b
---


A template report fills a Word or Excel template with data a script extracts, and produces a PDF. Create one when you need a formatted tabular document, such as a daily ticket summary or a record exported to a fixed layout.

<Callout type="info">
  A template report is not a report template. Report templates style charts and are described in [Report rendering customisation](page:reporting/customise-rendering).
</Callout>

## Before you begin

- You need the `administrator` role. Only administrators see the template report menu items.
- Prepare the Word or Excel template with placeholders for the data. The placeholder syntax is in [Template report scripts](page:reporting/template-report-scripts).
- Query only the data the report needs, for example records created or closed in the last day, week or month. Large queries slow the report down.

## Steps

<Steps>
  <Step>
    Select **Reporting → Reports → New template report**.
  </Step>
  <Step>
    Enter a **Name** and a **Description**. If the instance is multilingual (`system.multilingual` is true), also fill in **LocalizedName** and **LocalizedDescription**, which are then used instead.
  </Step>
  <Step>
    Enter a **Key**. Table operations and scheduled reports refer to the template report by this key.
  </Step>
  <Step>
    Attach the Word or Excel document to **Template**.
  </Step>
  <Step>
    Write the **Script** that extracts the data and sets `answer`. The script can read a `context` object to specialise the data.
  </Step>
  <Step>
    Save the template report, then run its table operation on the form to test it. Enter a context in the dialog, for example a table and a record ID, and run it.
  </Step>
  <Step>
    Check the generated PDF. Adjust the script or the template until the output is right.
  </Step>
</Steps>

## Variations

### Run from a table operation

To export a record to the template from its form, create a client-side table operation on the record's table. Its script builds the context and calls `Navigate.viewTemplateReport` with the template report's key. See [Table operations](page:automation/table-operations).

```javascript
let context = { id: current.getID(), table: current.getTableName() };

Navigate.viewTemplateReport("ServicelyReport", context);
```

### Run on a schedule

Add the template report to the **Template reports** field of a scheduled report. The scheduled report's **Context script** supplies the context. See [Schedule a report](page:reporting/scheduled-reports).

## Result

Running the template report produces a PDF built from the template and the script's data. From a table operation, the PDF opens for the current record. From a scheduled report, each recipient receives one PDF attachment per template report.

## Related

- [Template report scripts](page:reporting/template-report-scripts)
- [Schedule a report](page:reporting/scheduled-reports)
- [Table operations](page:automation/table-operations)
