Report Manager ← Back to site

HTML formatting and interpolation

Advanced report design

HTML formatting and interpolation

Text components can render a small subset of inline HTML and can interpolate report expressions inside their text. Both features are controlled by a single property, Is Html, on the component.

Enabling it: the Is Html property

Set the Is Html property of a text component to True. While it is False (the default), the text is printed verbatim – angle brackets and {{ }} markers are shown literally. Enabling Is Html turns on both inline HTML rendering and {{ }} interpolation at the same time, so existing reports are unaffected and nothing changes unless you opt in.

Supported HTML tags

The inline parser recognizes the following tags. Everything is laid out as inline text; there is no block layout.

TagEffect
<b>, <strong>Bold
<i>, <em>Italic
<u>Underline
<s>, <strike>, <del>Strikethrough
<br>Line break
<font face="Name" size="N" color="#RRGGBB">Font family, size and color
<span style="font-family:Name; font-size:Npt; color:#RRGGBB">Font family, size and color

Colors accept #RRGGBB, #RGB or a color name. The HTML entities &nbsp;, &lt;, &gt;, &amp;, &quot; and &#39; are decoded.

Interpolating expressions with {{ }}

When Is Html is True, every {{ expression }} found in the text is replaced by the value of expression, evaluated by the report expression evaluator. You can use fields and functions, for example {{CUSTOMER.NAME}} or {{UPPER(CUSTOMER.CITY)}}. If an expression cannot be evaluated, the original {{...}} placeholder is left untouched.

Labels and expressions behave differently

Where you place the HTML and the {{ }} markers depends on the component, because a TRpLabel prints static text while a TRpExpression first evaluates an expression and then prints the result.

TRpLabel – write the HTML and the interpolation directly in the label text. For example, set the label text to:

Customer: <b>{{CUSTOMER.NAME}}</b>

TRpExpression – the HTML must be produced by the expression itself, so a field value is inserted in one of two equivalent ways:

In both cases Is Html must be True. For expressions, the display format is applied to the evaluated value before the HTML and the {{ }} interpolation are processed.

Notes