Schema
Expressions
Master the expression syntax for dynamic content, variable access, and built-in formatting functions.
Overview
Expressions allow you to embed dynamic values in text components. They use the {{...}} delimiter syntax and are resolved at render time against the data context.
Syntax
Simple variables
Access top-level data properties by name:
{{title}}
{{invoiceNumber}}
Nested properties
Use dot notation to access nested objects:
{{customer.name}}
{{company.address.city}}
Function calls
Call built-in functions with arguments:
{{formatCurrency(price, 'USD')}}
{{formatDate(createdAt, 'yyyy-MM-dd')}}
{{uppercase(customer.name)}}
Mixed content
Expressions can appear anywhere in a text string alongside static text:
Invoice #{{invoiceNumber}} - {{formatDate(issueDate, 'MMMM d, yyyy')}}
Built-in functions
The engine provides 9 built-in functions for formatting and data manipulation:
| Function | Arguments | Example | Result |
|---|---|---|---|
formatCurrency | (value, currencyCode) | formatCurrency(1500, 'USD') | $1,500.00 |
formatDate | (value, pattern) | formatDate('2026-04-12', 'MMMM d, yyyy') | April 12, 2026 |
formatNumber | (value, decimals) | formatNumber(3.14159, 2) | 3.14 |
sum | (array, property) | sum(items, 'price') | 99.97 |
count | (array) | count(items) | 3 |
uppercase | (value) | uppercase('hello') | HELLO |
lowercase | (value) | lowercase('HELLO') | hello |
concat | (value1, value2, ...) | concat('Hello', ' ', 'World') | Hello World |
if | (condition, then, else) | if(total > 100, 'High', 'Low') | High or Low |
formatCurrency
Formats a number as currency using the specified currency code and the report’s locale:
{{formatCurrency(item.price, 'USD')}} → $29.99
{{formatCurrency(item.price, 'EUR')}} → €29.99
{{formatCurrency(item.price, 'TRY')}} → ₺29.99
formatDate
Formats a date string or Date object using a pattern:
{{formatDate(createdAt, 'yyyy-MM-dd')}} → 2026-04-12
{{formatDate(createdAt, 'MMMM d, yyyy')}} → April 12, 2026
{{formatDate(createdAt, 'dd/MM/yyyy')}} → 12/04/2026
formatNumber
Formats a number with a specified number of decimal places:
{{formatNumber(3.14159, 2)}} → 3.14
{{formatNumber(1000, 0)}} → 1,000
sum
Calculates the sum of a numeric property across all elements in an array:
{{sum(items, 'price')}} → 99.97
{{sum(items, 'quantity')}} → 42
count
Returns the number of elements in an array:
{{count(items)}} → 3
{{count(employees)}} → 12
uppercase / lowercase
Converts a string to upper or lower case:
{{uppercase(status)}} → ACTIVE
{{lowercase(category)}} → electronics
concat
Joins multiple values into a single string:
{{concat(firstName, ' ', lastName)}} → John Smith
if
Conditional expression that returns one of two values:
{{if(total > 1000, 'Premium', 'Standard')}}
{{if(quantity > 0, formatCurrency(quantity * price, 'USD'), '-')}}
Type coercion
The expression engine provides helper functions for explicit type conversion:
| Function | Description | Example |
|---|---|---|
toNumber | Converts to number | toNumber('42') -> 42 |
toDate | Converts to Date | toDate('2026-04-12') |
toBoolean | Converts to boolean | toBoolean(1) -> true |
toString | Converts to string | toString(42) -> '42' |
Expression context
Inside a detail band with dataBinding: 'items', the iterator variable (e.g., item) is added to the expression context. You can access both the iterator and top-level data:
{{item.name}} → current item's name
{{customer.name}} → top-level customer name
{{formatCurrency(item.price, currency)}} → uses top-level currency code
Next steps
- Data Binding — how data flows into bands and components
- Components — where expressions are used
- Render API — render reports with data via the REST API