Use this page to create the Template that Reporter will use to generate a Report. A Template is the reusable structure of the output file: it defines the layout, fields, conditions, loops, calculations, and final format.Documentation Index
Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
Use this file to discover all available pages before exploring further.
Objective
Add a Template that operators can select when generating Reports. For example, a monthly tax Template can define a CSV header, one row per transaction, and a total amount at the end of the file. A regulatory XML Template can define the required XML tags and fill them with values from a Data Source.
When to use
Use this task when:
- you are setting up the first Template for a report whose Data Source already exists;
- a new report obligation requires a new output structure;
- your team already has a reviewed
.tplfile and needs to make it available in the Console; - an operator needs to build the Template visually instead of editing
.tplcode.
Before you start
Confirm:
- the Data Source that will feed the Template is available when the Template needs database fields. It may be an internal source already configured for the environment or an external source added from Data Sources;
- the expected output format is known: CSV, XML, HTML, TXT, or PDF;
- the Template will be created in Template Builder or uploaded as a
.tplfile; - the report owner has confirmed the fields that must appear in the output.
A Template is not a generated Report. It is the reusable definition that Reporter applies later during report generation.
Option 1: Build in Template Builder
Use Template Builder when an operator needs to assemble the Template visually from blocks.
Name the Template
Use a name operators can recognize later, such as
Monthly tax CSV or Daily transaction PDF.Choose the output format
Select the format that the generated Report must produce: XML, HTML, CSV, TXT, or PDF.
Add the Template blocks
Add blocks such as Text, Variable, Loop, Conditional, or Aggregation. In practice, blocks represent the pieces of the final file: fixed text, database values, repeated rows, conditional sections, or totals.
Connect fields to data
Use the Data Sources sidebar to select fields from the configured database connection. For example, use a Variable block to place
transactions.amount in the output.Option 2: Upload a .tpl file
Use upload when a technical team already maintains the Template outside the Console.
Upload the file
In the File step, drag the
.tpl file to Drag file here, or click to select to browse your computer.Review the summary
In the Review step, confirm the file, name, and output format. Use the edit buttons if any field is wrong.
Field guide
Upload wizard fields
| Field | What to enter | Example |
|---|---|---|
| Template File (.tpl) | Required .tpl file used as the Template source. It must be larger than 0 bytes and no larger than 5 MB. API field: template. | monthly-tax.tpl |
| Template Name | Required operator-facing name. It maps to name in the Console and to description in the Reporter API. | Monthly tax CSV |
| Output Format | Required output type. Use one of csv, xml, html, txt, or pdf. | csv |
Template Builder fields
| Field | What to enter | Example |
|---|---|---|
| Template name | Required name in the builder header. It becomes the saved Template name and generated .tpl filename prefix. | Daily transaction PDF |
| Block toolbar | Add at least one block before saving. Blocks become the generated .tpl code. | Text header + Loop over transactions + Aggregation total |
| Data Sources sidebar | Use configured Data Sources to insert fields into Variable blocks. Technical fields include dataSource, table, and field. | production-postgres.transactions.amount |
Expected result
After saving, the Template appears on the Templates page and can be selected in the Generate Report wizard.
Common errors and care points
Uploading a file that is not `.tpl`
Uploading a file that is not `.tpl`
Upload only accepts
.tpl files. If the Template is still being designed, use Template Builder first or prepare the .tpl file outside the Console.Choosing the wrong output format
Choosing the wrong output format
The output format controls what kind of file operators will download after generating a Report. Confirm the required format before saving.
Creating a Template before the Data Source is ready
Creating a Template before the Data Source is ready
Templates can reference fields from Data Sources. If the required source is missing or untested, operators may not know which fields are safe to use.
Next steps
- Use Generate a Report to create a Report from the Template.
- Use Update a Template if the structure, file, name, or output format needs correction.
- Use Template Builder when operators need to maintain the Template visually.

