Skip to content

Subreport element

Another template laid out in place. It shares this report’s datasets and filters them by its parameters.

- { type: subreport, template: ... }
subreport.report.yaml
title: Customers and their orders
culture: en-US
data:
customers: { fields: { Id: int32, Name: string } }
orders: { fields: { CustomerId: int32, Number: string, Total: decimal } }
body:
dataset: customers
detail:
- gap: 2pt
content:
- { type: text, value: "{Name}", fontWeight: bold }
- { type: subreport, template: parts/customer-orders.report.yaml, parameters: { Customer: =Id }, width: 60% }
parts/customer-orders.report.yaml
# Used by subreport.report.yaml: one customer's orders.
culture: en-US
parameters:
Customer: { type: int32 }
data:
orders: { fields: { CustomerId: int32, Number: string, Total: decimal } }
body:
filter: =CustomerId == Customer
detail:
- layout: row
content:
- { type: text, value: "{Number}" }
- { type: text, value: "{Total:C}", align: end }
subreport.data.yaml
data:
customers:
- { Id: 1, Name: Contoso Ltd }
- { Id: 2, Name: Fabrikam Inc }
orders:
- { CustomerId: 1, Number: SO-1001, Total: 1250.00 }
- { CustomerId: 1, Number: SO-1007, Total: 312.40 }
- { CustomerId: 2, Number: SO-1003, Total: 480.50 }
The subreport example, rendered by Tagua.

Type: text · Required

Path of another template, resolved by the host.

Type: names to expression

Values for the subreport’s parameters, by name: expressions over the current row.

It also has the properties of every element and the style properties.