---
title: "Create a template report"
site: admin
version: 2027.1
versions: "all"
url: https://docs-new.servicely.ai/admin/2027.1/reporting/template-reports/
type: task
application: platform
last_updated: 2026-12-03
commit: 6777698daac5
---


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">
  **Changed in 2027.1.** Running a template report checks the user's permissions. A user who cannot read the template report gets an access error instead of a PDF. The shipped export operations also read the exported record with the user's permissions. Check that the people who run each template report can read it.
</Callout>

<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 → New template report**.

    <Image src="asset:screenshots/admin/reporting-template-reports/new-template-report-menu.png">The New template report item in the Reporting menu.</Image>
  </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.

    <Image src="asset:screenshots/admin/reporting-template-reports/new-template-report.png">The empty Create Template report form, with Name, Description, Key, the Template upload and the Script editor.</Image>
  </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/scripts/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/scripts/table-operations)
