Previous Next

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

Task 7:

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-16 General properties of the cross tab

Figure 17-16
5

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

Figure 17-17

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->Style->New Style.
4
crosstab_currency
5
6
7
1
2
3
4
Figure 17‑18 shows the currency values you set.

Figure 17-18 Format Number showing the currency setting

Figure 17-18
Format Number showing the currency settings
8
9

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

Figure 17-19
Text Block showing the change in text alignment
10
11

Figure 17-20 Data elements selected

Figure 17-20
12

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

Figure 17-21
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‑22. These labels are directly below [PRODUCTLINE] and Grand Total.

Figure 17-22 EXTENDED_PRICE labels selected

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

Figure 17-23 Preview of the cross tab

Figure 17-23

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-24 Outline view displaying the cross-tab styles

Figure 17-24
Outline view displaying the cross-tab styles
4
Right-click the crosstab style, then choose Edit Style.
5
6

Figure 17-25 Border colors set to Black

Figure 17-25
7
8
9
Use the same steps to set all the cell border colors to Black, then choose OK.
In the layout editor, the lines around the cells and around the cross tab appear in black, as shown in Figure 17‑26.

Figure 17-26 Cross tab design showing black borders

Figure 17-26
Cross tab design showing black borders
10
Preview the report. Figure 17‑27 shows a portion of the generated cross tab.

Figure 17-27 Preview of the finished cross tab

Figure 17-27


(c) Copyright Actuate Corporation 2008