Creating column bindings
When you drag a data set field from Data Explorer to a table in the layout editor, BIRT creates the column binding. When you bind a table to a data set, BIRT also creates a column binding for each field in the data set.
For other cases, when inserting a dynamic text, text, image, or data element from the palette, you manually create the column binding if you want the element to display dynamic data. If the information to display is static—for example, a specific image stored in a file system, or literal text—then column binding is not needed.
How to create a column binding
This procedure shows an example of creating a column binding for a data element.
1 Drag a data element from the palette and drop it in the report.
2 In New Data Binding, create a new column binding:
1 In Column Binding Name, specify a unique name for the column binding.
2 In Display Name, optionally specify a different name to display in the report design. If you leave this property blank, the report design displays the Column Binding Name value.
3 In Data Type, select a data type appropriate for the data returned by the expression you specify next.
4 In Expression, specify the expression that indicates the data to return, using one of the following methods:
*Type the expression directly in the Expression field.
Expression Builder button
*If you need help constructing the expression, choose the expression builder button to launch the expression builder. Figure 3‑4 shows an expression in the expression builder that combines the values of two data set fields selected from the Customers data set.
Figure 3-2 The expression builder showing a column-binding expressionFigure 3-2 The expression builder showing a column-binding expression
Figure 3‑4 The expression builder showing a column-binding expression
Choose OK when you finish constructing the expression. Figure 3‑5 shows an example of a column-binding definition.
Figure 3-3 New column-binding definitionFigure 3-3 New column-binding definition
Figure 3‑5 New column-binding definition
5 Choose OK to save the column binding.
In the layout editor, the report design displays [Contact_Name] in the location where you inserted the data element, indicating that the data element uses the column binding you defined.
3 Preview the report. The data element displays the data defined in the column binding expression.