Repository navigation
Report parameters
Declarative behavior — the document adapts to the data, no rigid bands.
"aggregate": "sum|count|avg|min|max" on a field definition computes totals over sibling rows:
- group footers (per parent group),
-
tfooton detail tables, - grand
summarysection.
"total": {"label": "Total", "format_mask": "float", "alignment": "right", "aggregate": "sum"}Unknown functions raise ValueError. Empty sets render nothing (no zero-noise).
"running_balance": "<source field>" fills a cumulative column in row order (bank statements). With opening balance:
"balance": {"label": "Balance", "format_mask": "float", "alignment": "right",
"running_balance": {"of": "amount", "start": 1000}}Non-numeric source values count as zero; input rows are never mutated. Invalid specs raise ValueError.
Keep only matching rows at that level:
"$print_when": {"field": "status", "not_equals": "cancelled"}Operators: equals, not_equals, in, not_in, gt, gte, lt, lte, is_null, not_null. Unknown operators raise ValueError.
"$order_by": [{"field": "date", "direction": "asc"}, {"field": "total", "direction": "desc"}]
"$order_by": "-total" # shorthand: "field" = asc, "-field" = descNull values always sort last. Stable for multiple keys.
"internal_code": {"label": "Code", ..., "visible": False}
"discount": {"label": "Discount", ..., "visible_when": {"field": "discount", "not_equals": 0}}visible_when supports "scope": "any" (default, hide unless some row matches) or "all".
"meta": {"page": {"size": "A4", "orientation": "landscape", "margins": {"top": ".4in"}}}Maps to page.pdf (format, landscape, margin); explicit pdf_options win. Invalid orientation raises ValueError.