< Previous | Next >

Lesson 2: Create the BIRT report design file

This lesson shows how to create a BIRT report design file for a model report.
You use the Report Explorer view to create a new UML report. You start with a template that populates the report with a data source for the UML metamodel and some standard data sets.
Data sources and data sets provide the data for BIRT reports:
  • A data source specifies where to obtain the data. For model reports, the data source is a set of models. You can use metamodels, instance models, or both.
  • A data set specifies the data to use in the report. For model reports, each data set is a table of data that is extracted from a data-source model. A data set consists of two parts: a "row-mapping" part, which finds the model objects for the rows of the table, and a "column-mapping" part, which finds attributes of the model objects and organizes them as columns. Both the row-mapping and column-mapping parts contain XPath expressions that use the metamodel structures to query a target instance model when you run the report design to generate a report.

To create the BIRT report design file:

  1. Create a folder for the report design file:
    1. In the Project Explorer view, right-click Sample reporting project; then click New > Folder.
    2. Type MyReport for the folder name, and click Finish.
  2. Create the report design file:
    1. Click Window > Show view > Other; expand Reporting and double-click Report Explorer.
    2. In the Report Explorer view, expand and then right-click UML Model; then click New Report.
    3. In the Add New Report window, for the report manager for the template, select UML Models.
    4. For the report to use as a starting template, click Blank UML Model Report and click Next.
    5. For the display name for the report, type Business Report.
    6. For the description of the report, type Reports on the business use cases and business actors in a UML model to which the Rational Business Modeling profile has been applied.
    7. Click Next.
    8. For the file name for the report, type businessReport.rptdesign.
    9. For the folder for the report, click Browse, navigate to the MyReport folder in the Sample Reporting Project, and click Finish. The new Business Report is displayed in the UML Model category in the Report Explorer view.

      The report is not displayed in the Project Explorer view until you refresh the view.

  3. Specify the sample business model as the data source for the report:
    1. In the Report Explorer view, right-click Business Report; then click Open. The businessReport.rptdesign file opens in the report design editor.
    2. Click the Data Explorer tab to open the Data Explorer view, expand Data Sources, right-click Main package; then click Edit.
    3. In the Edit Data Source window, beside the display area for instance models, click Add.
    4. In the Load Resources window, click Browse Workspace. Expand Sample reporting project, click Sample Business Model.emx, click OK, and click OK again.
      Note: If you specify an instance model as a data source, you can use example data to build data sets, and you can preview the report.

      The UML model that is listed in the data source under Metamodels is the UML.ecore metamodel. This metamodel is predefined for each UML data source, which means that you can use UML metamodel elements, as well as example data from the specified instance model, to build data sets.

    5. In the Edit Data Source window, click OK.
  4. Add the report title, model name, and model documentation to the report design:
    1. If the Palette is not displayed, click Window > Show view > Palette.
    2. To add a title to the report, in the Palette, click Label and drag the cursor into the report design editor.
    3. In the label box, type UML Business Use Case Report.
    4. Specify a font and background color for the title, and center the title text.
      Note: To specify characteristics such as font, background color, and alignment, right-click the label; then click Style > New Style.

      Use the pages of the New Style window to specify style characteristics. For example, you can center text in the Text Block page. You can also assign a descriptive name to a style in the General page; this makes it easy to apply the same style to other similar report design elements. It also helps you find the style if you want to modify it.

      For more information about using BIRT features such as the palette and styles, see the Field Guide to BIRT in the online help for your product. You might want to experiment with different styles as you work through this tutorial.

    5. In the Data Explorer view, expand Data Sets and expand All Named Elements.
    6. Drag name into the report design editor below the title.
    7. Specify the font and background color for the model name, center the model name, and assign it a bottom margin of 24 points. You use the Box page of the Style window to assign margins.
    8. In the Palette, click Dynamic Text and drag the cursor into the report design editor. The Expression Builder opens. Unlike data items, dynamic text items preserve rich text formatting from the model documentation.
    9. In the Expression field, type row["documentation"] and click OK.
    10. Click Window > Show View > Property Editor and in the Property Editor – Dynamic Text view, click the Binding tab.
    11. In the Data Sets field, select Package Root.
    12. To save the report, click File > Save.
    13. Click the Preview tab in the report design editor. The model name and documentation from the Sample Business Model.emx instance model are displayed. The English version of the report should look similar the following figure, though the characteristics of the styles that you used in your report are probably different:

Now you are ready to add content to the report.

< Previous | Next >

Feedback