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:
- Create a report.
- Identify the library and configuration for the data source.
- Create a table for the report and delete unwanted columns.
- Add associated primary tasks to the layout.
- Add work products to the layout.
- Finalize the report layout and review the result.
Step 1. Create a report
- Starting in the Rational Method Composer workbench, click the Open Perspective icon in the top-right corner, and then select Other.
- In the Open Perspective dialog (Figure 1), select Report Design.
Figure 1. Open Perspective dialog
- 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
- Enter a name for the report, and then click the Next button.
- Select Blank report, and then click the Finish button. (See Figure 3.)
Figure 3. Selecting blank report
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
Step 2. Identify the method library and configuration for the data source
- 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).
- Click Next.
Figure 5. Select a data source
- Specify both the location of the method library and the method configuration (Figure 6), and then click Finish.
- (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.
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
- 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.
- After clicking the Data Explorer tab, right-click on Data Set, and then select New Data Set.
Figure 7. Select a data set
- Under Data Set Name, type Roles, and then click Next.
Figure 8. Name the data set
- 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.)
- Click OK, and then click Finish.
- 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
- Click OK when you are finished.
- 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
Step 3. Create a table for the report and delete unwanted columns
- 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
- Click on each column, one at a time, and delete these, keeping only presentationName (Figure 12):
Figure 12. Edit the table
- Go to Preview, and you will see a list of Roles in the library.
Step 4. Add associated primary tasks to the report layout
- 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
- 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
- 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
- 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
- Under the Filters tab, click the Add button.
- In the New Filter Condition dialog, click the fx button (see Figure 17).
Figure 17. Add a filter condition
- 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
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:
- 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.
Figure 19. Create a filter expression
- Then click the Tasks table and double-click guid. This will insert the tasks guid after
- Finish typing in the expression:
- row._outer[ primaryTasks ].indexOf(row[ guid ])!=-1
- Now, click OK.
Figure 20. Complete the filter expression
- 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
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
- 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
- Click presentationName in the Roles table, and right-click to select Edit to change the name. Change it to
- 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
- Go to the Preview tab in the Report Designer to see the results.
Step 5. Add work products to the report layout
- Create another column to the right of the Roles primary tasks column.
- 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.
- Follow the steps given previously for the Tasks data set.
- 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.
- You need the roles that are responsible for work products, so double-click responsibleFor to insert that information into the Expression Builder.
- Then select the workproducts table and double-click guid. Then build the expression as Figure 25 shows.
Figure 25. Build the expression
- Click OK, and then change the filter expression as Figure 26 shows.
Figure 26. Edit the filter expression
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.
- Click on Outline, and then expand Body to see the table rows, columns, cells, headers, and so forth.
Figure 27. Display table outline
- 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
- 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
- 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
- Go to Preview to see the results, which should look something like Figure 31.
Figure 31. Preview results
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
- Read author Tushara Gangavaram's introductory article in this series: "Using BIRT reports with IBM Rational Method Composer: Getting started."
- To learn more about Rational Method Composer and RUP, visit the resource area on developerWorks Rational. You'll find technical documentation, how-to articles, education, downloads, product information, and more.
- Visit the Rational software area on developerWorks for technical resources and best practices for Rational Software Delivery Platform products.
- Explore Rational computer-based and Web-based courses. Hone your skills and learn more about Rational tools with these courses, which range from introductory to advanced. The courses on this catalog are available for purchase through computer-based training or Web-based training. Additionally, some "Getting Started" courses are available free of charge.
- Subscribe to the Rational Edge newsletter for articles on the concepts behind effective software development.
- Subscribe to the IBM developerWorks newsletter, a weekly update on the best of developerWorks tutorials, articles, downloads, community activities, webcasts and events.
- Browse the technology bookstore for books on these and other technical topics.
Get products and technologies
- Download trial versions of IBM Rational software.
- Download IBM product evaluation versions and get your hands on application development tools and middleware products from DB2®, Lotus®, Rational®, Tivoli®, and WebSphere®.
- Participate in the Rational Method Composer and RUP discussion forum.
- Check out developerWorks blogs and get involved in the developerWorks community.
Dig deeper into Rational software on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Experiment with new directions in software development.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.