< Previous | Next >

Lesson 3: Add UML diagrams to the report design

This lesson shows how to add UML diagrams to a BIRT report design file.


To add UML diagrams:

  1. To continue designing, click the Layout tab in the report design editor.
  2. Add a title for a section for use-case diagrams to the report:
    1. In the Palette, click Label and drag the cursor into the report design editor below the row["documentation"] box.
    2. In the label box, type Use Case Diagrams.
    3. Create a style for the label to specify a font and border, and to add a page break before the label. You use the Page Break page in the New Style window to add page breaks.
  3. Create a data set:
    1. In the Data Explorer view, expand Data Sets.
    2. Right-click Package Diagrams; then click Copy. Right-click again; then click Paste.
    3. Right-click Package Diagrams1; then click Rename and change the name to Use Case Diagrams.
    4. In the Data Explorer view, right-click Use Case Diagrams; then click Edit.
    5. In the Edit Data Set window, click Row Mapping.
    6. Delete the contents of the Expression field.
    7. In the Expression field, press Ctrl+Space to display a list of XPath functions, and double-click oclQuery.
      Note: The XPath language is used to express queries for both the rows and columns of each UML model data set. You can write expressions that navigate the structure of the model because the XPath parser understands EMF-based models. For example, you can create a data set of all the UML actors in the model using //Actor, even though in the XML document for the model no node named "Actor" exists.
    8. In the Edit Data Set window, in the left pane under Browse, click the down arrow; then click the entry for Sample Business Model.emx, which displays the model structure hierarchy.
    9. In the model structure hierarchy, click Sample Use Case Diagram.
    10. In the Expression field, confirm that inputXPath is selected in the oclQuery expression, and click the right-arrow (>) button for the Expression field. The input XPath is now getDiagrams(Model).
    11. Change getDiagrams(Model) to getDiagrams(//*).
    12. In the XPath expression, replace inputOCLQuery with self.type = 'Usecase'. The XPath expression now reads: oclQuery(getDiagrams(//*),"self.type = 'Usecase'").
    13. Click OK.
  4. Add the use case diagram names and images:
    1. Add a table to display the use case diagrams: In the Palette, click Table and drag the cursor into the report design editor.
    2. In the Insert Table window, set Number of columns to 1 and set Number of details to 2.
    3. In the Data Set field, select Use Case Diagrams and click OK.
    4. Right-click the Table icon and define a new style for the table that specifies a top padding of 12 points.
    5. In the Data Explorer view, expand Use Case Diagrams and drag name onto the first Detail Row in the table.
    6. Delete the name label that was automatically added to the Header Row above the Detail Row.
    7. In a new style for the row that contains the name, specify the font style.
    8. In the Palette (not the Data Explorer view), click Image and drag the cursor into the second Detail Row in the table.
    9. In the Edit Image Item window, click Dynamic image and click Select Image Data.
    10. In the Select Data Binding window, select the check box for image and click OK.
    11. Click Insert.
    12. Right-click the row icon for the row with the image; then define a new style, using the Text Block page to center the image. You might have to click the row to display the row icon.
    13. Save the report design file.
    14. In the report design editor, click the Preview tab. The English version of the report should look similar to the following figure:
      " "


Now go on to add stereotype data to the report.

< Previous | Next >