Appearance
RFML by example
Small, whole RFML documents in the markup notation (RFML §27), each laid out below it in your browser by the same engine that renders reports. The docs site's build checks every one with the current engine, so they stay valid as RFML changes. The example gallery holds full reports.
A page of text
A document needs meta (a title, here with a locale and currency for formatting), at least one page template, and a body. Styles are CSS: rules on document and classes, with tokens as custom properties.
rfml
<rfml version="0.2" id="notice">
<meta title="Water main works" locale="en-AU" currency="AUD"/>
<styles>
:root { --brand: #0073AF; --muted: #4E6A75; }
document { font-family: Arimo; font-size: 10pt; line-height: 1.4; color: #231F20; }
.kicker { color: var(--brand); font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8pt; }
.muted { color: var(--muted); }
</styles>
<page id="a5" size="A5" margin="15mm"/>
<body>
<text id="kicker" class="kicker">Larkmere Water</text>
<heading id="title" level="1" style="font-size: 18pt; margin: 2pt 0 8pt">Water main works in Quarry Road</heading>
<text id="intro">From Monday 9 November, crews will replace 400 metres of water main between Mill Street and the river.</text>
<text id="when" style="margin-top: 6pt">Supply will be off between 9 am and 1 pm on the day your section is connected. We will leave a card at least two days before.</text>
<text id="sign-off" class="muted" style="margin-top: 12pt">Faults and emergencies: 1300 975 708</text>
</body>
</rfml>A table bound to a list
A bound table repeats its columns' cells for every item of its source, here a list in vars. Expressions go in {{ }}; Format formats numbers and money in the document's locale, and a column's footer can sum the rows.
rfml
<rfml version="0.2" id="charges">
<meta title="Charges" locale="en-AU" currency="AUD"/>
<vars>
<var name="charges">[{'service': 'Water usage', 'kl': 48.2, 'amount': 159.06}, {'service': 'Water service charge', 'kl': 0.0, 'amount': 61.20}, {'service': 'Wastewater', 'kl': 0.0, 'amount': 147.35}]</var>
</vars>
<styles>
document { font-family: Arimo; font-size: 9pt; color: #231F20; }
.money { text-align: right; }
</styles>
<page id="a5" size="A5" margin="15mm"/>
<body>
<heading id="title" level="2" style="margin-bottom: 6pt">This quarter's charges</heading>
<table id="charges-table" source="vars.charges" as="line">
<column id="col-service" width="3fr" header="Service">{{ line.service }}</column>
<column id="col-amount" width="1fr" header="Amount" class="money"
footer="{{ Format(Sum(region.rows.map(r, r.amount)), 'currency') }}">
{{ Format(line.amount, 'currency') }}
</column>
</table>
</body>
</rfml>