Dear Mr. Scott Johnson,
Dear Ms. Ella Parker,
As the example shows, a conditional expression can have one of two values based on a condition. The syntax for this conditional expression is:
condition ? value1 : value2
If the condition is true, the expression has the value of value1; otherwise, it has the value of value2.
Alternatively, you can use an if...else statement within the VALUE-OF tag. The following text displays the same results as the preceding conditional expression:
Dear <VALUE-OF>if(row["Sex"] == "M"){
Title = "Mr."
}
else{
Title = "Ms."
}</VALUE-OF>
<VALUE-OF>row["Name"]</VALUE-OF>,
Combining a value from a data set field and static text
The following example shows how to use the VALUE-OF tag to insert dynamic values that data set fields return.
Text that you supply:
Dear <VALUE-OF>row["contact_firstname"]</VALUE-OF>,
<p>
Thank you for your recent order. Order <VALUE-OF>
row["orderID"]</VALUE-OF> will be shipped by <VALUE-OF>
row["shipByDate"]</VALUE-OF>.
Output:
Dear Bob,
Thank you for your recent order. Order 1115 will be shipped
by Apr 17, 2009 12:00AM.
You can display field values in a text element only if the following requirements are met:

The text element has access to the data set that contains the fields.

If you place the text element directly on the page, you must bind the text element to the data set that contains the field value. To do so, select the text element, choose the Binding tab in the property editor, then select the data set to which to bind. Placing the text element directly on the page, however, displays only one value.

If you place the text element in the detail row of a table or a list to display all values of a data set field, bind the table or list to the data set.

A column binding is created for each data set field. The column binding refers to the data set field. The VALUE-OF tag refers to the column binding.
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.
Displaying data set field values that are stored as HTML text
Sometimes values in a data set field contain HTML text. If you insert such a field in a report, BIRT Report Designer displays the content of the field exactly as it appears in the data source, including the HTML tags. To display the text with its intended formatting, use a text element or a dynamic text element instead of a data element. As described earlier in this chapter, the text element enables you to add static text to the dynamic text, whereas the dynamic text element displays all the HTML tags if you add static text.
To use the text element, select HTML as the text type, then use the VALUE‑OF tag to insert the value of the field, and set the format attribute to HTML, as shown in the following example.
Text that you supply:
Notes: <VALUE-OF format="html">row["CustomerNotes"]</VALUE-OF>
Output:
Notes: The customer wants email confirmation for his orders.