< Previous | Next >

Creating a simple column report

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:

  1. If the report template is closed, open the myTest.rptdesign file and click the Layout tab at the bottom of the Report Editor view.
  2. Create a title for the report:
    1. Open the Palette view by clicking the Palette tab.
    2. From the Palette view, select and drag a Label element into the Layout page of the Report Editor.
    3. Double-click the label in the Report Editor and enter the following text for the label: My Test Report.
    4. In the Property Editor, select the General tab.
    5. Set the font to bold. Click the Bold button (Bold button).
    6. Align the text in the center of the label. Click the Center button (Center button). The General tab should look like the following image:

      Formatting text in the Outline view.

    In the Report Editor, the report title text is bold and center-aligned.
  3. Add a table to the report:
    1. From the Palette view, drag a Table element into the Layout window after the report title. The Insert Table window opens.
    2. 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.

  4. Add a name for the table and update the format of the table:
    1. Open the Outline view.
    2. Click MyTest.rptdesign > Body > Table.
      Selected table element in the Outline view.

      The Property Editor view displays the table element properties.

    3. In the Property Editor view, select the General tab.
    4. In the Name field, type Columns.
    5. Set the text to be left-aligned. Click the Left button (Left align 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.

  5. Add the Name and Data Type elements from the Column data set to the table:
    1. Open the Data Explorer view.
    2. Expand the Data Sets > Column node and drag the Name element to the left column of the detail row in the table.
    3. Expand the Data Sets > Column 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:

    Name and Data Type columns added to the report

  6. Set the table property to sort the data in the table by the data type, then by column name:
    1. Open the Outline view.
    2. Expand the MyTest.rptdesign > Body node, then select Table - Columns. The Table - Columns element opens in the Property Editor view.
    3. In the Property Editor, select the Sorting tab. Click Add.

      The New Sort Key window opens.

    4. In the Key field, select Data Type and click OK.
    5. Click the Add button to add another sort key.
    6. 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.
    Name and Data Type columns added to the report
  7. 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.
    Preview of the column and data type report
You created a basic report.
Next, you will further refine the report to group and sort the data.
< Previous | Next >

Feedback