Using BIRT reports with IBM Rational Method Composer: An intermediate-level example of creating BIRT reports

Step-by-step instructions

This article explains how to create a basic Business Intelligence and Reporting Tools (BIRT) report that extracts information from IBM® Rational® Method Composer, Version 7.2.

Share:

Tushara Gangavaram (tgang@us.ibm.com), Tech Services Engineer, IBM Japan

Tushara GangavaramTushara Gangavaram provides tech services to the Rational Unified Process content team and Rational Method Composer development team. She is also responsible for G11N, publishing and QA for Rational Unified Process content and libraries.



17 February 2008

The report example used in this article displays all roles, and for each role, displays the primary tasks and related work products. This step-by-step walkthrough covers these primary steps:

  1. Create a report.
  2. Identify the library and configuration for the data source.
  3. Create a table for the report and delete unwanted columns.
  4. Add associated primary tasks to the layout.
  5. Add work products to the layout.
  6. Finalize the report layout and review the result.

Step 1. Create a report

  1. Starting in the Rational Method Composer workbench, click the Open Perspective icon in the top-right corner, and then select Other.
  1. In the Open Perspective dialog (Figure 1), select Report Design.
Figure 1. Open Perspective dialog
image of workspace
  1. From within the Report Design perspective (Figure 2), at the bottom-left corner, there is a tab for the Navigator view where you can see the directory structure of the library. Right-click where you want to put the report, and select New and Report from the drop-down menu.
Figure 2. Caption
image of menu command
  1. Enter a name for the report, and then click the Next button.
  1. Select Blank report, and then click the Finish button. (See Figure 3.)
Figure 3. Selecting blank report
image of workspace

The new blank report opens in the Report Designer on the right side. On the left side, you can see the Data Explorer tab, which is where you will create data sources (Figure 4). In Rational Method Composer, a data source is a library plus a configuration.

Figure 4. Creating data sources
image of workspace

Step 2. Identify the method library and configuration for the data source

  1. Right-click Data Source, select New Data Source, and then select Method Library Data Source. (There is an option to enter a name but, in this example, just use the default name, Data Source).
  1. Click Next.
Figure 5. Select a data source
image of workspace
  1. Specify both the location of the method library and the method configuration (Figure 6), and then click Finish.
  1. (Optional) If you want to work with the library that is currently open, you can also use the check boxes to select Currently open library and Currently selected configuration.

Note:
If there is no method configuration selected while you were in the Authoring perspective, you will get a messaging alerting you that there is no method configuration selected. You can then select the method configuration from the drop-down menu.

Figure 6. Specify a location
image of workspace
  1. Create data sets for roles, tasks, and work products. These are basically queries against data that will be extracted from the data source (the method library and configuration), and then used to populate the report.
  1. After clicking the Data Explorer tab, right-click on Data Set, and then select New Data Set.
Figure 7. Select a data set
image of menu command
  1. Under Data Set Name, type Roles, and then click Next.
Figure 8. Name the data set
image of workspace
  1. Under Element type select Role in the drop-menu, and check the following attributes in the Edit Data Set wizard:
    • Name. Iinternal name (not currently displayed in the report, but could be useful in a future version of the report).
    • GUID. Used to link to work products and tasks in the other data sets.
    • Presentation Name. External name.
    • Responsible For. Used to link to responsible work products.
    • Primary Tasks. The GUIDs of the primary tasks are linked to the actual tasks to display them.
    • Method Plug-in. In case you want elements based on plug-in. (This is optional.)
  1. Click OK, and then click Finish.
  1. When the Edit Data Set - Roles dialog appears, click Preview Results to see the output. You should see a table with the selected attributes.
Figure 9. Edit data set attributes
image of workspace
  1. Click OK when you are finished.
  1. Similarly, create data sets for tasks and work products (element types are Task and Work Product), as Figure 10 shows. Under Tasks, you can see the fields selected for the Task element type. Similarily, under Workproducts, you see the fields selected for the Work Product element type.
Figure 10. Create data sets for element types
image of workspace

Step 3. Create a table for the report and delete unwanted columns

  1. Drag and drop the Roles data set into the new report editor. You will see something like what Figure 11 shows.
Figure 11. Create a table
image of workspace
  1. Click on each column, one at a time, and delete these, keeping only presentationName (Figure 12):
    • Name
    • GUID
    • responsibleFor
    • primaryTask
    • methodPlugin
Figure 12. Edit the table
image of workspace
  1. Go to Preview, and you will see a list of Roles in the library.

Step 4. Add associated primary tasks to the report layout

  1. Now, right-click on the remaining column and select Insert > Column to the Right to add a column (see Figure 13).
Figure 13. Insert new column
image of menu command
  1. Drag the Tasks data set into the second cell of the new column, as shown in Figure 14.
Figure 14. Add the Tasks data set
image of workspace
  1. Delete the Name, GUID, and the methodPlugin columns. Keep only presentationName, as you did for the Roles data set. Delete the first row, which is nothing but headings, as Figure 15 shows.
Figure 15. Edit the Tasks data set
image of workspace
  1. Click the Table icon to open Properties. When you hover your cursor over the Tasks table, you should be able to see the icon shown in Figure 16. In the Properties editor, click the Filters tab.
Figure 16. Create data filters
image of workspace
  1. Under the Filters tab, click the Add button.
  1. In the New Filter Condition dialog, click the fx button (see Figure 17).
Figure 17. Add a filter condition
image of dialog box
  1. Next, in the Expression Builder dialog, under Category, select Available Column Bindings. You will see the two tables that you dragged into the report editor (Figure 18).
Figure 18. Create column bindings
image of workspace

You need each role's primary tasks, because you must match primaryTasks GUID in the Roles data set with the tasks GUID in the Tasks data set. You do that by creating a filter expression:

  1. Select the second table and double-click primaryTasks. This action will insert that informationinto the Expression Builder. Type this expression, as shown in Figure 19.
.indexOf(
Figure 19. Create a filter expression
image of workspace
  1. Then click the Tasks table and double-click guid. This will insert the tasks guid after indexOf(.
  1. Finish typing in the expression:
- row._outer[ primaryTasks ].indexOf(row[ guid ])!=-1
  1. Now, click OK.
Figure 20. Complete the filter expression
image of workspace
  1. After you click OK, you will see the New Filter Condition dialog. From that, select isTrue from the drop-down menu, and then click OK.
Figure 21. Add filter condition
image of workspace

This sets the filter to list only the tasks here that are related to the role through primaryTask. The expression is written from the perspective of the Task data set (the table that you selected). From the role, row._outer retrieves the list of guids that represent all tasks related to the role. Then indexOf tries to find the tasks guid in that list. The expression is True when it is found so that that tasks name can be listed here in the table.

In the report editor's Properties view, you will see something like Figure 22.

Figure 22. Filter properties
image of workspace
  1. Delete the extra footer row in the Tasks table. (You deleted the header in Step 2 of this section.) You should now see what Figure 23 shows.
Figure 23. Edit Tasks table
image of workspace
  1. Click presentationName in the Roles table, and right-click to select Edit to change the name. Change it to Roles.
  1. In the right column, click an empty row, and right-click to select Insert > Text. Then enter the Roles primary tasks.
Figure 24. Add primary tasks for Roles
image of workspace
  1. Go to the Preview tab in the Report Designer to see the results.

Step 5. Add work products to the report layout

  1. Create another column to the right of the Roles primary tasks column.
  1. Drag the workproducts data set (table) into the editor, as you did the previous data sets, and then delete all columns except for Presentation Name.
  1. Follow the steps given previously for the Tasks data set.
  1. Hover the cursor over the workproducts data set, and you will see the table icon. Click that icon to get the Properties editor, and then click the Filters tab.
  1. You need the roles that are responsible for work products, so double-click responsibleFor to insert that information into the Expression Builder.
  1. Then select the workproducts table and double-click guid. Then build the expression as Figure 25 shows.
Figure 25. Build the expression
image of workspace
  1. Click OK, and then change the filter expression as Figure 26 shows.
Figure 26. Edit the filter expression
image of workspace

Step 6. Finalize the report layout and view the result

When you preview results, they are not aligned properly. To create a table, follow these steps.

  1. Click on Outline, and then expand Body to see the table rows, columns, cells, headers, and so forth.
Figure 27. Display table outline
image of workspace
  1. Click Cell and, in the report's Properties editor, you will see borders. Because there are two tables within the Roles data set, or table, you will see multiple table cells and rows under the Outline tab. When you click on the border around the full square to add a border to the cell selected. Do the same for all cells, and then click Save.
Figure 28. Format cell borders
image of workspace
  1. Go to the Preview tab in the Report Designer view to see the results. You can change the border colors by clicking on Color tab. To sort the results, hover the cursor over the Roles data set table. In the Properties editor, click the Sorting tab .
Figure 29. Sort the results
image of workspace
  1. Next, click Add. From the dialog box that results, select Presentation name in the drop-down menu, and then click OK.
Figure 30. Create sort key
image of workspace
  1. Go to Preview to see the results, which should look something like Figure 31.
Figure 31. Preview results
image of workspace

There are also options to view the report in different formats, including HTML, PPT, PDF, DOC, and others (see Figure 32).

Figure 32. Report view options
image of workspace

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=289247
ArticleTitle=Using BIRT reports with IBM Rational Method Composer: An intermediate-level example of creating BIRT reports
publish-date=02172008