Skip to main content

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.

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.

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 .tpl file and needs to make it available in the Console;
  • an operator needs to build the Template visually instead of editing .tpl code.
Do not use this task to fix a Template that already exists. Use Update a Template instead.

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 .tpl file;
  • 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.
1

Open Template Builder

Go to the Templates page and click Template Builder.
2

Name the Template

Use a name operators can recognize later, such as Monthly tax CSV or Daily transaction PDF.
3

Choose the output format

Select the format that the generated Report must produce: XML, HTML, CSV, TXT, or PDF.
4

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.
5

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.
6

Save the Template

Click Save to validate the blocks and save the generated .tpl file.

Option 2: Upload a .tpl file


Use upload when a technical team already maintains the Template outside the Console.
1

Open the upload wizard

Go to the Templates page and click New Template.
2

Upload the file

In the File step, drag the .tpl file to Drag file here, or click to select to browse your computer.
3

Configure the Template

In the Config step, fill in Template Name and Output Format.
4

Review the summary

In the Review step, confirm the file, name, and output format. Use the edit buttons if any field is wrong.
5

Save the Template

Click Save Template.
API equivalent: Upload template endpoint

Field guide


Upload wizard fields

FieldWhat to enterExample
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 NameRequired operator-facing name. It maps to name in the Console and to description in the Reporter API.Monthly tax CSV
Output FormatRequired output type. Use one of csv, xml, html, txt, or pdf.csv

Template Builder fields

FieldWhat to enterExample
Template nameRequired name in the builder header. It becomes the saved Template name and generated .tpl filename prefix.Daily transaction PDF
Block toolbarAdd at least one block before saving. Blocks become the generated .tpl code.Text header + Loop over transactions + Aggregation total
Data Sources sidebarUse 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


Upload only accepts .tpl files. If the Template is still being designed, use Template Builder first or prepare the .tpl file outside the Console.
The output format controls what kind of file operators will download after generating a Report. Confirm the required format before saving.
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