The reporting lifecycle
Every report in Reporter follows the same four-stage lifecycle:
The sections below explain each stage.
Design a template
A template is a plain-text file with a
.tpl extension that defines how your report looks and what data it includes. Templates mirror the structure of the final output — if you want an XML report, you write XML inside the .tpl file; if you want HTML, you write HTML.
Instead of writing SQL queries, you reference data through placeholders that follow a simple path syntax:
{{ midaz_onboarding.account.name }} pulls the account name from the Midaz onboarding database.
What you can do in templates
| Capability | Description |
|---|---|
| Loops | Iterate over collections of records |
| Conditions | Show or hide content based on data values |
| Aggregations | Calculate sums, averages, counts, min, and max |
| Arithmetic | Perform calculations on numeric fields |
| Filters | Transform values inline (format numbers, replace strings, extract substrings) |
| Counters | Track and display running totals across iterations |
Supported output formats
| Template content | Output format |
|---|---|
CSV-structured .tpl | CSV file |
XML-structured .tpl | XML file |
HTML-structured .tpl | HTML or PDF file |
TXT-structured .tpl | TXT file |
Upload the template
Once your
.tpl file is ready, upload it to Reporter. During upload, you specify:
- The template file — your
.tplfile - Output format — the format Reporter should generate (CSV, XML, HTML, PDF, or TXT)
- Description — an optional label to help identify the template later
Templates are reusable. Upload once, generate reports from the same template as many times as needed with different filters.
Generate a report
To generate a report, submit a request with the template ID and optional filters that narrow the data.
How filters work
Filters follow a structured path: data source > table > field. You can filter by equality, ranges, greater/less than, and list membership. For example, to generate a report for a specific date range and account status:| Filter | What it does |
|---|---|
createdAt: between ["2024-01-01", "2024-01-31"] | Only include records from January 2024 |
status: in ["active", "pending"] | Only include active or pending accounts |
id: eq ["123", "456"] | Only include specific account IDs |
Supported filter operators
| Operator | Description |
|---|---|
eq | Equal to |
gt / gte | Greater than / greater than or equal |
lt / lte | Less than / less than or equal |
between | Value falls within a range |
in / nin | Value is / is not in a list |
Processing
Report generation is asynchronous. After submitting a request, Reporter returns a report ID that you use to check progress. Reports move through two statuses:| Status | Meaning |
|---|---|
processing | Reporter is querying data and rendering the template |
finished | The report is ready for download |
Download the output
Once a report reaches
finished status, download it. The file is returned in the format specified during template upload — CSV, XML, HTML, PDF, or TXT.
Data sources
Reporter connects to your databases and pulls data based on what your templates reference. It supports:
| Database | Use case |
|---|---|
| PostgreSQL | Relational data — accounts, transactions, ledger entries |
| MongoDB | Document data — metadata, flexible schemas |
midaz_onboarding or midaz_transaction).
Multi-schema support
For PostgreSQL databases with multiple schemas, templates can query across schemas using explicit syntax:sales, inventory, and reporting within a single database.
Example scenario
A fintech company needs to generate a daily account summary for its operations team. Setup:
- A template designer writes an HTML template with account balances, transaction counts, and daily totals using Reporter’s aggregation tags
- The template is uploaded once with output format set to PDF
- An automated job submits a report request with a date filter for the current day.
- Reporter queries the Midaz database, applies the template logic, and renders the output.
- The report reaches
finishedstatus within seconds. - The operations team downloads the PDF and reviews the daily summary.
- The same template is reused every day — only the date filter changes.
Brazilian regulatory reporting
Reporter includes ready-to-use templates for Brazilian Central Bank (BACEN) regulatory reports:
| Template | Purpose |
|---|---|
| CADOC 4010 / 4016 | Trial balance and balance sheet reporting |
| CADOC 4111 | Detailed transaction reporting |
| CCS | Customer and account registry reporting |
Next steps
What is Reporter?
Full overview of Reporter’s architecture and capabilities.
Template formats
Practical examples for HTML, XML, and TXT templates.
Trial balance report
End-to-end guide for generating trial balances with Midaz and Reporter.
BACEN templates
Ready-to-use templates for Brazilian regulatory reporting.

