You are on page 1of 6

Report Studio – Report with a Master-Detail Relationship in Cognos 8 BI

Task 1 - Create a new List report that includes the information to be printed in the first list.
1. Log on to ReportNet and open ReportStudio. Select the eFinancePLUS package. To create a new report, choose
File, New from the pull-down menu.
2. From the dialog box that appears, single-click List and then click OK.

3. From the Insertable Objects pane, make sure the Model tab is selected. Single-click on the plus (+) sign to the
left of End User to open the folder, then expand Human Resources and Employee Info.
4. Select Employee Number, Full Name, Department Title, and Base Location Building Name.
6. Create any filters and/or prompts you need on this data to limit the results you see.

Task 2 - Add a page break by employee to the report.
1. Now we want to add a page break to the report. There are 2 options, depending on how you have things setup
in your report, the easiest way to create a page break is to select the field you want to page break on, such as
Employee Number and from the Structure Menu at the top of the page, select the option to Set Page Break, as
below:

2. If the above option is not available ( greyed out) due to how your report is setup, you can follow the steps below
as well. Click on the vertical Page Explorer bar, or hover over it (it’s between the Insertable Objects pane and
the work area) and then select Report Pages.

1 6/17/2013

 4. 2 6/17/2013 . Organize the pages in the report by dragging report pages into the same page set. Below you should see a screen shot of the properties pane as well as the popup window for the Grouping & Sorting. Insert the page containing details in the Detail Pages folder. 6. From the Insertable Objects pane drag a Page Set into your Report Pages pane. Next double click on the white space to the right of Grouping & Sorting in the properties pane. Select the Page Set1 again and then in the properties pane change the query to point to the query you want to associate to the page set. similar to below: 5.Report Studio – Report with a Master-Detail Relationship in Cognos 8 BI 3. so the query you want to create the page break from. in our case it defaults Query2 and we need to change this to Query1.

From the report page click on the toolbox tab in your Insertable Objects pane. Once you add your table. into that sort list to sort by the Employee’s name rather than number. When you are done viewing the report.Setup the layout of your page and add new lists. 8.Report Studio – Report with a Master-Detail Relationship in Cognos 8 BI 7. For this example I will select as follows: Then Click OK. In our example we want to page break on Employee Number so to do this double click on Employee Number on Data Items side and it will add under Groups to the Groups side. 6. Click OK. 9. 3. Task 3 . click the X in the upper- right corner to close the report viewer. You have now added a page break for Employee Number. Save your report. Click the Run button to execute the report. Now if you want that page break to sort by the employee name rather than by the number. When you add the table it will prompt you for how many rows and columns. 1. 4. select the two columns in the first row and merge them into 1 column using the merge button from your toolbar: 5. 2. after the list that is already on the page. Select any item in the first list then from the Properties pane click on the ancestor button 3 6/17/2013 . Drag the Full Name. To do this select the table from the toolbox and drag it onto the report page. or whatever version of the name you used on your report. Next we want to move our existing list into that newly merged cell. you need to add the sort value to the sort list folder inside the Employee Number field as below. Let’s first add a table to the page so we can organize how our data will appear on the page.

From the properties window scroll down to the padding property and edit that. Similar to below. I will select both the cells that the new text items are in and go to the properties window. 12. I want to put an Employee’s Deduction data and Leave Info as separate lists in the extra cells of our table. To do this. Mine looks like the following: 11. depending on what field you had selected in your list before clicking on the ancestor button: I will select List 8. Adjust the popup window as desired. 10. Next let’s add 2 new lists to the report. I will add titles for each of those next. Click OK 13. This will give you a popup to select a level in the report higher from what you currently have selected. Now you can click and drag your list into the table and it should look similar to below: 9. Next I will add some padding above the new text items to space them down a bit from the list. I set mine as below: only setting padding on the top edge. depending on how you want it to look. 4 6/17/2013 . From the toolbox drag a text item into the cell just below the existing list and type in what you want it to say. from the toolbox drag a list into each cell below our new text items.Report Studio – Report with a Master-Detail Relationship in Cognos 8 BI 7. You can adjust any side you want.

17. in my sample I am adding all the 1st thru 3rd leave fields. The next step is to now link these 2 queries to the master query. Next we need to add the data that we want to each of these new lists. The most important item to add to each list is the Employee Number as this is the field we need to use to link to the main query in the report. and add the needed leave info for what you want to show. 18. Deduction Status and Deduction Amount. expand the Payroll folder. I will filter the data to limit it to a active Deduction Status only. Next let’s create the last list on the report. From there add the Deduction Code. 20. the Leave List. We already defined the master query when we setup the page break in our report. To get the Leave Info from inside Human Resources. but don’t need to display them in the list. Then for the deduction query we need to add the deuction data we want to include.Report Studio – Report with a Master-Detail Relationship in Cognos 8 BI 14. To link these. 16. start with one of them and select any field in the list. Near the bottom of the menu. 19. It now looks something like this: I can now cut the Employee Number and Deduction Status as I will just use thest behind the scenes. and then expand Deductions folder. 15. So add that first. select the Data menu. you will see an option for Master Detail Relationships… select this option and you will see a window similar to the following: 5 6/17/2013 . Next I will apply an ascending sort to the Deduction Code fields by selecting it then clicking on the sort button and selecting Ascending. Now you may need to filter the data you see in the deductions list. From inside Human Resources. Deduction Title. then expand the Leave Info folder. it now looks something like below: 21. Then from the menus across the top of the screen. 22. either the attendance list or the guardian list. expand the Payroll Info folder. We also need to add the Employee Number to this list.

then we would simply click on the field in the left or right query to create the link between the appropriate fields. To do this click on the New Link button at the top and it will default a link between the first field in each query similar to below: 24. we are now ready to test run our report and see one page per employee with 2 extra lists showing data relating to the employee on that page. We now need to create a link between the Master and Detail queries. Next repeat the same steps for the Leave Detail Query. 25. Once we have these links setup. so we don’t need to make any changes. similar to the following: 26. In this case the Employee Number is the first field in both queries.Report Studio – Report with a Master-Detail Relationship in Cognos 8 BI 23. 6 6/17/2013 . but if it was not.