- Understanding column bindings
- Creating column bindings
- Editing and deleting column bindings
- More about column-binding expressions
Editing and deleting column bindings
Be careful when editing or deleting column bindings. More than one element can use a column binding, and a column binding can refer to other column bindings. Renaming or deleting a column binding that is used by multiple elements often results in errors in the report design. Consider the following scenario:
BIRT Report Designer creates a column binding named CUSTOMER_COUNTRY at the table level that refers to the data set field, CUSTOMER_COUNTRY, when you drop the field in a table. You create a sort condition to display rows alphabetically by country names. The sort expression uses the CUSTOMER_COUNTRY column binding. Later, you select the data element that uses CUSTOMER _COUNTRY, and you change the column-binding name to COUNTRY. When you run the report, you get an error message, because the sort expression still refers to the CUSTOMER_COUNTRY column binding, which no longer exists. Similarly, if you delete the CUSTOMER_COUNTRY column binding, the same error occurs, because the sort expression now refers to a non-existent column binding.
If you edit the name of a column binding, you need to manually update all other elements that refer to the column binding. In the previous example, you would need to edit the table's Sort Key value to use the renamed column binding. Do not confuse this type of change with changes to a column binding's defined expression. Earlier in this chapter, you saw examples of how a change to a calculated-data expression cascaded to other expressions that used the higher level expression. Remember these guidelines:
- A change to a column binding's expression applies to other column bindings that refer to that column binding.
- A change to a column binding's name does not change other references to that column binding. Column-binding names are case sensitive. COUNTRY and Country are two different names.