Expression Engine
The expression engine lets you define calculated fields and conditional values anywhere a data property is accepted in Report Forge.
Where expressions are used
- Calculated column in a tablix.
- Conditional colour or visibility rule.
- KPI tile value.
- Text block with dynamic content.
- Chart series value.
Expression syntax
Expressions use a simple formula syntax similar to spreadsheet formulas. Each expression returns a typed value (text, number, date, or boolean).
[FieldName] -- reference a bound field
123 -- numeric literal
"text" -- string literal
TODAY() -- function call
[ActualFinish] - [BaselineFinish] -- arithmetic
IF([Float] < 0, "Critical", "Float") -- conditional
Common functions
| Function | Returns | Example |
|---|---|---|
IF(cond, a, b) | a or b | IF([Float]<0,"Critical","OK") |
DATEDIFF(d1,d2,"d") | Number | DATEDIFF([Start],[Finish],"d") |
TODAY() | Date | TODAY() |
ROUND(n, d) | Number | ROUND([Progress],1) |
CONCAT(a, b) | Text | CONCAT([ID]," - ",[Name]) |
ISNULL(a, b) | a or b | ISNULL([ActualStart],[PlannedStart]) |
ABS(n) | Number | ABS([Variance]) |
SUM([Field]) | Number | Used in aggregated contexts |
COUNT([Field]) | Number | Used in aggregated contexts |
FORMATDATE(d,"fmt") | Text | FORMATDATE([Start],"dd MMM yy") |
Editing an expression
- Open the Properties panel for a component.
- Select any property that accepts an expression.
- Click the fx icon to open the expression editor.
- Type or build the expression. The editor shows a live preview.
- Confirm. If the expression is invalid, an inline error appears.
Full function reference
For the complete list of supported functions with parameters and examples, see Expression Reference.