Skip to content
© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Subreports

A subreport is a reusable report template designed to be embedded inside a master report. The master report provides context (a list of entities); the subreport renders once per entity, producing a dedicated section for each.

Subreports are not scheduled or generated independently — they only exist as components within a master report.

Prerequisites: Familiarity with the Report Builder.


Scenario Why subreports help
Per-entity sections Generate one alarm table, chart, or summary block per device or asset in a single run
Reusable layout blocks Define a standard section once and embed it in multiple master reports
Divided responsibilities Teams can own individual subreport templates independently of the master layout

In addition to standard entity aliases, subreport templates support two special aliases that resolve to the entity passed from the master report. See Subreport aliases for details.

Alias Resolves to
Entity from master report The entity passed to this subreport by the master report. One subreport instance is generated per entity if the master’s datasource returns multiple.
Owner of entity from master report The customer or tenant that owns the entity passed by the master report

  1. Navigate to Monitor ⇾ Reports ⇾ Templates.
  2. Click + Add report template ⇾ Create new report template.
  3. Enter a report template name (e.g. Daily Device Alarms (Subreport)).
  4. Select:
    • Format: PDF or CSV.
    • Type: Subreport.
  5. Click Add to open the Report Builder.
  6. Build the subreport content using the Entity from master report alias:
    • Add a Rich text component — use ${Name} (mapped to the name entity field) to display the entity name as a section header.
    • Add an Alarm table component — datasource: Entity from master report, time window: Current day, title: ${entityName} Alarms.
    • Add a Divider component to separate sections visually.
  7. Save the subreport template.

The template opens in the Report Builder — a drag-and-drop editor where you compose the layout.


  1. Click + Add report template — Format: PDF, Type: Report.
  2. Name the master report (e.g. Daily Device Alarms Report).
  3. Add a Heading component with the report title.
  4. Drag a Subreport component into the content area.
  5. Data tab:
    • Datasource: an alias returning all target devices (e.g. All devices).
    • Subreport template: select Daily Device Alarms (Subreport).
  6. Save the master report.

Daily Alarm Report per Device Using Subreports — step-by-step walkthrough: create a subreport template and a master report that generates one alarm section per device in a single PDF.