> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# Reports

> Write a report in Markdown: frontmatter with the period and paper, prose with metric references, dashboard blocks in fences, and page breaks, printed as a PDF.

A report is a document for people who read it away from the dashboard: a monthly business review,
a board update, a note for a customer. It is mostly words, with a few KPIs, charts and tables
between them. You write it as Markdown in `reports/<name>.md`; the numbers in the words and the
blocks come from the same metrics and queries as every dashboard, so they never disagree.

````text theme={null}
---
title: October 2026 business review
period:
  asOf: 2026-10-31
  range: last_complete_month
  compare: previous_year
pdf:
  paper: letter
---

Revenue was **{{revenue}}** in October, {{revenue.change_pct}} against
{{revenue.previous}} a year earlier. Refunds ran at {{refund_rate}} of orders.

```hatchmark
type: kpi
metric: revenue
```

## Where the growth came from

Americas carried most of the change; EMEA was flat.

```hatchmark
type: line
title: Revenue by day, by region
metrics: [revenue]
grain: day
split: region
```

---

## Countries

```hatchmark
type: table
by: [country]
metrics: [revenue, orders]
percentOfTotal: [revenue]
limit: 15
```
````

`hatchmark render 2026-10 --out october.pdf` prints it, and `hatchmark build` writes it as a page
next to the dashboards, at `dist/2026-10/index.html`.

## The parts

* **Frontmatter**, between two `---` lines at the top, is YAML with a dashboard's `title`,
  `description` and `period` ([Dashboards](/docs/reference/dashboards.md)), plus `filters` and
  `pdf` below. A reader can also
  [pick a category](/docs/reference/dashboards.md#picking-a-category) in a block to filter the rest
  of the page; the pick goes into the page's address, and printing the page from the browser
  prints what the pick shows.
* **Prose** is the Markdown of a [text block](/docs/components/text.md#markdown), with `{{metric}}`
  references, plus `##` and `###` section headings. The report's own heading is its `title`, so a
  `#` heading is an error (HM3020), and so are images, tables and HTML.
* **A fence tagged `hatchmark`** holds one block, written exactly as an item of a dashboard's `blocks`:
  `kpi`, `line`, `table` and every other block type, such as a [table](/docs/components/table.md). A fence holds one
  block as a mapping; an empty fence, a list or a fence with no closing line is an error (HM1010).
* **A `---` line** between blocks starts a new page in the PDF. On screen it draws nothing.

The prose between two fences becomes one text block, so a diagnostic in it or in a fence names the
line of the report, as it would in a dashboard file.

## Numbers in the words

Write every number as a reference such as `{{revenue}}` or `{{revenue.change_pct}}`, never by
hand: check warns about an amount or a percentage typed into the prose (HM5054), because it would
not follow the data. References read the metric over the report's `period` and print what a KPI of
that metric prints ([text block references](/docs/components/text.md#references)).

A report with a fixed `asOf` date is a record of that period: its numbers and its words stay true.
With `asOf: latest_data` the numbers move with every build but the words do not, so a sentence such
as "Americas carried most of the change" can become false. Give a report you rebuild every month
words that stay true, or fix its `asOf`.

## Paper

| Field | Meaning |
| - | - |
| `pdf.paper` | `letter` (default) or `a4`. |
| `pdf.landscape` | `true` prints the pages in landscape; default `false`. |

These are the defaults when `hatchmark render` prints the report; `--paper` and `--landscape` on
the command line win. Everything else about the printed pages, the footer, the fitting of tables and
the page PNGs, is as for a dashboard ([Render to PNG or PDF](/docs/reference/render.md#pdf-reports)).

## Names

A report's name is its file name without `.md`, with the same rules as a dashboard name. A report
and a dashboard cannot share a name (HM1004), since both are pages of the same site and both are
arguments to `render`.

## Filters

A report takes [select filters](/docs/reference/dashboards.md#select-filter), so one report can tell
the same story for each team, region or plan:

```yaml theme={null}
filters:
  - type: select
    id: region
    label: Region
    column: region
    options: [Americas, EMEA, APAC]
```

The control sits right above the first block it filters, and stays at the top of the window while
any of the blocks it filters is on screen; blocks whose tables don't have the column keep showing
every row. With few choices it's a row of buttons, so the reader switches with one click. The
choice goes into the page's address. `hatchmark render` prints the default, and
`--filter region=EMEA` prints another ([Render to PNG or PDF](/docs/reference/render.md#filters)). A report has no period, grain
or segment filter: its period is the one in its frontmatter.

## On screen

`hatchmark build` writes each report as a page in a single reading column, listed in the
project's navigation with the dashboards. It has no period picker; the period in the header is the
report's own. Picking a category in a block filters the other blocks, as on a dashboard.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.