Click here to Skip to main content
13,355,018 members (59,620 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


8 bookmarked
Posted 19 Oct 2011

Master Details Report in SSRS 2008

, 19 Oct 2011
Rate this:
Please Sign up or sign in to vote.
How to create a Master Detail or Summary Detail report in SSRS 2008


How can we create a Master Detail or Summary Detail report in SSRS 2008?


  1. Add a New Report in the report solution & name it as “MasterDetails” report.
  2. Create a data source.
  3. Create 2 datasets as “dsMaster” & “dsDetails”.
  4. To create these 2 datasets, find some master detail table, e.g., AccountType ? Master Table & Accounts ? Detail table.
  5. First create the query for Master as below, dsMaster.
    SELECT ID, AccountType, Description FROM AccountType
  6. Then create the query for Details, dsDetails.
    SELECT AccountID, DateCreated, Income, Expenditure FROM Accounts
    WHERE AccountType = @AccountType.
  7. Once we do this, @AccountType parameter will be added in our parameter list as shown in the figure below:


  8. Right click on the “AccountTypeID” parameter
    1. On the General Tab of this parameter, go to the “Select parameter visibility” & select “Hidden” from the list. (This step is done so that when we view our report, this parameter won’t be visible in the parameter list. The value for this parameter is handled internally which is the next step to be done.)
    2. Now go to the “Default Values” Tab & select “Specify values”


    3. Click on the Add button, a dropdown will be visible.
    4. Now click on the “fx” button & write the below expression for the default value for the parameter.
    5. Now click on “Ok”, this will set our parameter. (This step will assign a default value to our parameter. If you fail to do this step, an error will be raised as parameter is not assigned any value.)
  9. Now on the Design areas, add 2 tables, one for Master & other for Details.
  10. Select the dataset as “dsMaster” for the first table, this table will show our Master table.
  11. Select the dataset as “dsDetails” for the second table, this table will show our Details table.
  12. Now on the Master table, click on the column detail where you want to do a drill through.
  13. In our example, I have selected this for “Description”.
  14. Right Click on the Description textbox, go to the “Text Box Properties”.
  15. On the “Text Box Properties”, go to the “Action” tab.
  16. On the “Action” tab, select “Go to report” hyperlink, after this go to “Specify a report” section, there select the Current report on which we are working (in our e.g., it is “MasterDetails”).
  17. Now map all parameters which are required to load this report, add it using the “Add” button.
  18. In our case, we have only 1 parameter as “AccountTypeID”, select it from the drop down list.
  19. For the value for this parameter, select the ID from the drop down list, this is from the 1st dataset, i.e. “dsMaster”. Please refer to the below figure for the settings:


  20. Now click on Ok.
  21. Now go to the “Font” tab & in the Effect area select “Underline”, this will help the user to identify that there is a link on this cell.
  22. Once this is done, the next step is to handle the visibility of the “Details” table.
  23. This can be done as follows, 1st map the “Details” table with the “dsDetail” data set.
  24. Now right click & select the “Tablix properties”.
  25. Go to the “Visibility” tab of the “Tablix properties”.
  26. Here go to the “When the report is initially run” section & select “Show or hide based on an expression.
  27. Once you select this, a text box will become visible. Now click on the “fx” button & write the following expression:
    =IIF(Parameters!AccountTypeID.Value <> -1, False, True)
  28. This expression helps us to control the visibility of the 2nd table i.e. “Details” table.
  29. Please note: When you are handling the visibility of the 2nd table, make sure the parameter which you are selecting for controlling the visibility should have a value which is not there in our DB.
  30. Now click on the “Ok” button.
  31. Now preview the report, it will only show the “Master” table first. But when you click on the “Description” cell, the “Details” table will become visible.
  32. In this way, we can implement the “Master Details” report in SSRS 2008.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

India India
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionHow to indicate master selected row? Pin
dareno218-Sep-14 3:46
memberdareno218-Sep-14 3:46 
AnswerRe: How to indicate master selected row? Pin
dareno218-Sep-14 22:57
memberdareno218-Sep-14 22:57 
GeneralNice Article Pin
Marutha8824-Apr-14 12:44
memberMarutha8824-Apr-14 12:44 
QuestionThis is superb article . I loved It !!! Pin
priyanka18863-Mar-12 9:56
memberpriyanka18863-Mar-12 9:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 19 Oct 2011
Article Copyright 2011 by BIUser_2011
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid