Copying data elements
Another action to be careful about is copying and pasting data elements. In a report that displays the same or similar data in multiple places, the natural inclination is to copy the data element and paste it elsewhere in the report. For example, you want to display the order ID in two places: the detail row and header row of a table. You already inserted the order ID data element in the detail row, so you copy the data element and paste it in the header row. When you run the report, the order ID appears in both places.
Later, you decide to add static text, Order Number:, to the order ID value that appears in the header row. You double-click the data element in the header row, and change the expression in the Edit Data Binding dialog from:
dataSetRow["ORDERNUMBER"]
to
"Order Number: " + dataSetRow["ORDERNUMBER"]
When you choose OK to save the change, BIRT prompts you to choose one of the following options:
*Create a new column binding for the selected data element. This option enables you to make changes only to the selected data element.
*Update both data elements to use the new expression.
Figure 3‑7 shows the message that BIRT displays when you edit an expression for a column binding that is used by multiple data elements.
Figure 3‑7 Options for editing a column-binding expression
When you copy and paste a data element, all the copies refer to a single instance of the column binding. Because this behavior is not apparent, BIRT asks how you want a change in a column binding’s expression or data type to be processed. Otherwise, you might assume that selecting a data element and editing its column binding information affects only the selected data element.