Previous Next

Task 7:  Format the report

Now that you verified that the report displays the correct data in the correct order, you can turn your attention to improving the report’s appearance. You perform the following tasks in this section:

*
*
*
*

Edit the column headings

1  
2  
3  
Replace CUSTOMERNAME with the following text:
Customer
4  
Repeat steps 2 and 3 to change the second and third column headings to the following text:
Phone
Contact
The report design should look like the one shown in Figure 1-23.

Figure 1-23 Revised column headings in a report design

Figure 1-23  Revised column headings in a report design

Format the column headings

To format a report element, set its properties in one of the following two ways:

*
*

You might notice that in the report design, the column headings appear in plain text and are center-aligned. The generated HTML report, however, displays the column headings in bold and centered. This discrepancy occurs because BIRT uses the browser’s default format for items placed in a table header.

In this procedure, you use the Property Editor to align the column headings to the left, and you define a style to add color to the header row.

1  
1  

Figure 1-24 Properties for selected elements in Property Editor

Figure 1-24  Properties for selected elements in Property Editor

Left button

2  

Bold button

3  
4  
2  
1  
New Style appears, as shown in Figure 1-25. The left side displays the property categories. The right side displays the properties for the category that you select.

Figure 1-25 New Style

Figure 1-25  New Style
2  
table_header_row
3  
4  
*
*
Choose OK.
5  

Figure 1-26 Guide cells at top and left of a table

Figure 1-26  Guide cells at the top and left of a table
6  
7  
8  
3  

Figure 1-27 Report preview showing header row style

Figure 1-27  Report preview showing header row style

Display first and last names on the same line

When you place multiple elements in a single cell, BIRT Report Designer creates block-level elements. If you are familiar with HTML, you know that each block element starts on a new line. To display multiple elements on the same line, you need to set them as inline elements. Alternatively, you can concatenate the first and last name values to display in a single data element, as described in this procedure.

1  
2  
3  
Edit Data Binding, shown in Figure 1-28, shows information about the data associated with the current data element. In Expression, dataSetRow["CONTACTFIRSTNAME"] indicates that the data element displays data from the CONTACTFIRSTNAME field in the data set.

Figure 1-28 Edit Data Binding

Figure 1-28  Edit Data Binding

Expression Builder button

4  
The expression builder displays the expression in the text area at the top of the window.
5  
dataSetRow["CONTACTFIRSTNAME"] + " " + dataSetRow["CONTACTLASTNAME"]
Figure 1-29 shows this expression in the expression builder. The empty quotation marks (" ") add a space between the first name and last name. You can type the expression in the text area or double-click an item in the lower right of the window to insert it in the expression.

Figure 1-29 The expression builder displaying the expression to concatenate data

Figure 1-29  The expression builder displaying the expression to concatenate data
6  
The edited expression appears in Edit Data Binding.
7  
8  

Figure 1-30 Report preview showing concatenated contact names

Figure 1-30  Report preview showing concatenated contact names

Increase the space between rows

The default layout adds a minimum space between table rows. Typically, you will want to adjust the spacing between rows.

1  
2  

Figure 1-31 Selected table row in the layout editor

Figure 1-31  Selected table row in the layout editor
Property Editor displays the properties for the row. The title that appears in Property Editor shows the type of element that you select, so you should see Property Editor—Row.
3  

Figure 1-32 Row height set to 24 points

Figure 1-32  Row height set to 24 points
4  

Figure 1-33 Report preview showing increased row spacing

Figure 1-33  Report preview showing increased row spacing

(c) Copyright Actuate Corporation 2013