In this lesson, you build a simple column report that lists
the names and data types of all columns that are in the physical data
model.
In this lesson, you create a basic report. You add a BIRT
table element with two columns to the report design. The table will
list the names and data types of the columns in your schema. You create
this report in response to a request from application developers.
The application developers need to identify columns and their data
types. The application developers can then use this information to
create better applications that can query the data that is contained
in the database.
To create a simple column report:
- If the report template is closed, open the myTest.rptdesign file
and click the Layout tab at the bottom of the Report
Editor view.
- Create a title for the report:
- Open the Palette view by clicking
the Palette tab.
- From the Palette view, select and
drag a Label element into the Layout page of
the Report Editor.
- Double-click the label in the Report Editor and enter
the following text for the label: My Test Report.
- In the Property Editor, select
the General tab.
- Set the font to bold. Click the Bold button
(
).
- Align the text in the center of the label. Click
the Center button (
). The General tab
should look like the following image:
In the Report Editor, the report title text is bold and
center-aligned.
- Add a table to the report:
- From the Palette view, drag a Table element
into the Layout window after the report title. The Insert
Table window opens.
- Complete the fields of the Insert Table window,
then click OK:
Field |
Setting |
Number of Columns |
Specify 2 columns. |
Data Set |
Specify Column from the
list of options. |
A two-column table is inserted into the report. The
table contains a header row, a detail row, and a footer row. The Column data
set is associated with the table.
The Column data
set is a predefined data set in the report design. In the Data
Explorer view, you can see the data sets that are defined
for the report design.
- Add a name for the table and update the format of the table:
- Open the Outline view.
- Click .
The Property Editor view displays
the table element properties.
- In the Property Editor view, select
the General tab.
- In the Name field, type Columns.
- Set the text to be left-aligned. Click the Left button
(
).The format of the table and all of
the contents of the table can be set at the table level. You can override
the properties within the table by selecting the element and updating
the properties.
- Add the Name and Data
Type elements from the Column data
set to the table:
- Open the Data Explorer view.
- Expand the node and drag the Name element
to the left column of the detail row in the table.
- Expand the node and drag the Data
Type element to the right column of the detail row in
the table.
When you drag the Name and Data
Type elements into the detail row, a label with the column
name is added to the header row. The report should look like the following
image:
- Set the table property to sort the data in the table by
the data type, then by column name:
- Open the Outline view.
- Expand the node, then select Table
- Columns. The Table - Columns element
opens in the Property Editor view.
- In the Property Editor, select
the Sorting tab. Click Add.
The New Sort Key window opens.
- In the Key field, select Data
Type and click OK.
- Click the Add button to add another
sort key.
- In the Key field, select Name and
click OK.
You created two sort keys for the table. When you generate
the report, the information in the table is sorted by Data
Type and then by Name.
- Preview the report. In the Report Editor view,
select the Preview tab at the bottom of the
view. A preview of the report lists the table column
names sorted by data type. For each data type, the columns are sorted
in alphabetical order by name.
You created a basic report.
Next, you will further refine the report to group and sort
the data.