Displaying data values in one row
For typical listing reports, data is best presented in rows and columns in a table, as shown in numerous examples. If, however, a table displays data from one field only and the field contains a few values, you can improve the presentation by displaying all the values in one row. Compare the following layouts for displaying the locations of sales offices.
Layout 1:
Sales Offices:
London
New York
Paris
Layout 2:
Sales Offices: London, New York, Paris
The first layout uses a table conventionally. Figure 8‑45 shows the report design. The table’s header row contains a label to display the column heading, Sales Offices. The detail row contains the CITY field, which displays each city value in a separate row.
Figure 8‑45 Table layout to display cities, each in a separate row
The second layout also uses a table. In this design, shown in Figure 8‑46, the table’s header row contains a text element. This text element displays the static text, Sales Offices:, and refers to a column binding that returns the list of cities. The column binding uses the CONCATENATE function to join all the city values into a single string value.
Figure 8‑46 Table layout to display cities in one row
How to display data values in one row
1 Insert a table and bind it to the data set that contains the field from which to display values.
2 Create a column binding to return all the field values in a single string.
1 Select the table, and in Property Editor, select the Binding tab.
2 In the Binding page, choose Add Aggregation.
3 In Aggregation Builder, specify the following information:
*In Column Binding Name, type a name to identify the column binding.
*In Function, select CONCATENATE from the drop-down list. Aggregation Builder selects String as the data type.
*In Expression, select the field from which to concatenate values.
*In Separator, optionally type a character or characters to insert between each value. A common separator is a comma followed by a space. You must enclose the separator value in double quotation marks (" "), as shown in the following example:
", "
*In Max length, specify the maximum number of characters returned, including the separator characters. If you do not set a value for this property, CONCATENATE returns all the values in the field.
*In Show all values, type true to include duplicate values. If you do not set a value for this property, CONCATENATE excludes duplicate values.
Figure 8‑47 shows the column binding defined for the report example shown in Figure 8‑46.
Figure 8‑47 Definition of column binding using the CONCATENATE function
3 In the table’s header row, insert a text or data element to display the string returned by the column binding. Figure 8‑48 shows the contents of the text element used in the report example shown in Figure 8‑46.
Figure 8‑48 Text specified for the text element