Displaying Text : Using a text element : Formatting dynamic values in a text element
 
Formatting dynamic values in a text element
The previous examples show how to use the VALUE-OF tag to insert dynamic values that a JavaScript function or a field returns. Sometimes the returned values are not in the desired format. You can reformat the values using the format attribute, as shown in the following example.
Text that you supply:
<VALUE-OF format="MM-dd-yy">new Date()</VALUE-OF><br>
<VALUE-OF format="$#,###.00">row["orderTotal"]</VALUE-OF><br>
<VALUE-OF format="(@@@) @@@-@@@@">row["phone"]</VALUE-OF>
Output:
04-17-05
$321,000.00
(415) 123-5555
The format pattern must be enclosed in quotation marks. You can use any format pattern that the Format Number, Format DateTime, and Format String properties support. For information about these properties, see Formatting Report Content.