< Previous | Next >

Lesson 4: Add stereotype data to the report design

This lesson shows how to add stereotype data to a BIRT report design.
To add stereotype data:
  1. To continue designing, click the Layout tab in the report design editor.
  2. Create a data set for business use cases:
    1. In the Data Explorer view, right-click Data Sets; then click New Data Set.
    2. In the Data Set Name field, type Business Use Cases, click Next, and click Next again.
    3. On the Row Mapping page, click in the Expression field, press Ctrl+Space, and double-click getElementsWithStereotype.
    4. In the expression, replace inputXPath with //*, and replace inputStereotypes with Business Modeling::BusinessUseCase. When you generate the report, this expression finds all the elements in the model that are stereotyped as a business use case.
    5. Set the value for Type to uml:UseCase. To do this, under Browse, click the down arrow and click Sample Business Model.emx.
    6. In the model structure hierarchy, click <BusinessUseCase> Sample Use Case, click the right-arrow (>) button for the Type field, and click OK.
    7. Set the value for Stereotypes to Business Modeling::BusinessUseCase. To do this, click the right-arrow button for the Stereotypes field.
    8. Click Next to go to the Column Mapping page.
    9. Under Browse, click the down arrow, and click uml:UseCase.
    10. In the structure hierarchy, click name, and then click the right-arrow button.
    11. Under Browse, click the down arrow, and click Business Modeling::BusinessUseCase, which displays the structure hierarchy for the stereotypes.
    12. In the structure hierarchy, click the Category stereotype attribute and click the right-arrow button.
    13. Edit the query for the Category item by adding /@name to the end of the expression. The category value is an enumeration literal, but the report should show the name of the category literal.
    14. In the structure hierarchy, click the Possibilities stereotype attribute, and click the right-arrow button.
    15. In the structure hierarchy, click the SpecialRequirements stereotype attribute and click the right-arrow button.
    16. Click Finish.
    17. In the Edit Data Set window, click OK.
  3. Add a business use-case table to the report.
    1. At the end of the report, add a section for business use cases: In the Palette view, click Label and drag the cursor into the report design editor.
    2. Set the label text to Business Use Cases and apply the style that you used for the Use Case Diagrams label. Remember that this style includes a page break before the label.
    3. From the Data Explorer, drag Business Use Cases to the end of the report design. When you generate the report, BIRT creates a table with data for each column of the Business Use Cases data set.
    4. Change the header label name to Use Case Name.
    5. To create a style for all the column headers in the table, click the Table icon below the tab, and right-click the icon for the Table Header row. In the style, specify a font and background color for the column headers.
    6. In a separate style for the table, add a 12–point margin at the top and bottom of the table.
    7. Save the report design file.
    8. In the report design editor, click the Preview tab. The stereotype property values of the business use case from the Sample Business Model.emx instance model are displayed. Except for the differences in style characteristics, the English version of the report should look similar to the following figure:
      " "
Continue your report design by adding group data.
< Previous | Next >

Feedback