Previous Next

Presenting Data in a Cross Tab : Tutorial 6: Creating a cross tab : Task 8: Format the cross tab

Task 8:

Now that the cross tab displays the correct data, you can focus on improving the presentation of data in the cross tab. You perform the following tasks in this section:

n
n
n
n

Display a string in empty cells

If there are no sales for a particular product in a particular state, the cell displays nothing. Because an empty cell can be interpreted as missing data, you can display a string, such as 0.00 or --, to indicate that the value is zero.

1
2
3
4

Figure 17-17 General properties of the cross tab

Figure 17 17
5

Figure 17-18 Preview of the cross tab showing -- to indicate no data

Figure 17 18

Change the format of the numbers

To indicate that the numbers displayed in the cross tab are dollar amounts, use the currency format. It is also easier to read the numbers if they are aligned to the right.

1
2
3
Choose Element->New Style.
4
crosstab_currency
5
6
7
1
2
3
4
Figure 17‑19 shows the currency values you set.

Figure 17-19 Format Number showing the currency setting

Figure 17 19
8
9

Figure 17-20 Text Block showing the change in text alignment

Figure 17 20
10
11

Figure 17-21 Data elements selected

Figure 17 21
12

Figure 17-22 Select the crosstab_currency style to apply to the data elements

Figure 17 22
13

Edit the column headings

When you insert a summary field, BIRT adds a label that displays the field name as a column heading. In the generated cross tab, the heading EXTENDED_PRICE appears in every column below the product line names. Because the cross tab displays values from one summary field only, the label is not necessary.

1
2
Select the two labels that display EXTENDED_PRICE, as shown in Figure 17‑23. These labels are directly below [PRODUCTLINE] and Grand Total.

Figure 17-23 EXTENDED_PRICE labels selected

Figure 17 23
3
4
Preview the report. Figure 17‑24 shows a portion of the generated cross tab.

Figure 17-24 Preview of the cross tab

Figure 17 24

Use darker lines around the cross tab and the cells

BIRT uses two predefined styles, crosstab and crosstab-cell, to set the default appearance of the overall cross tab and the cells, respectively.

1
2
3

Figure 17-25 Outline view displaying the cross-tab styles

Figure 17 25
4
5
6

Figure 17-26 Border colors set to Black

Figure 17 26
7
8
9
In the layout editor, the lines around the cells and around the cross tab appear in black, as shown in Figure 17‑27.

Figure 17-27 Cross tab design showing black borders

Figure 17 27
10
Preview the report. Figure 17‑28 shows a portion of the generated cross tab.

Figure 17-28 Preview of the finished cross tab

Figure 17 28


(c) Copyright Actuate Corporation 2008