Parameter passing from main report to subreport mdx RRS feed

  • Question

  • Hello All,

    I am working on a project to generate reports ssrs, from cube. 

    I have one main report in which there are two columns which will point to 2 different subreports. I have worked on this subreports before on oltp but not with cubes, when i pass the parameters it pulls up the subreport but not the parameterized output instead it asks me to select those parameteres agian in the subreport.

    It means its not binding those parameters correctly not sure whats wrong, it's not giving any error but its giving same as if i have run the subreport individually i.e, i have to pull and select the parameteres to get output which i dont want to do.

    Any help is really appreciated.

    Friday, May 18, 2012 9:25 PM


All replies

  • I am not familiar with cube, but I have successfully done this in SSRS 2008 R2.  See if this helps...

    Go into the main report, select the subreport object and right click on it.

    In the context menu, select Subreport Properties.

    On the Parameters page, set each of the subreport parameters to a parameter in the main report, or to a variable in the main report.

    Friday, May 18, 2012 9:56 PM
    • Marked as answer by Elvis Long Friday, June 1, 2012 2:13 AM
    Monday, May 21, 2012 3:58 AM
  • hi SQLKiller,

    Are you defining Actions on your report?

    I have one main report in which there are two columns which will point to 2 different subreports.

    Follow these stpes instead:

    Click on the cell --> Textbox Properties -->Click on Action --> Define the fields and remember to click on Go To Report --> Bind the necessary parameters to run the report.

    Please vote as helpful or mark as answer, if it helps
    Cheers, Raunak | t: @raunakjhawar | My Blog

    Monday, May 21, 2012 5:28 AM
  • Hi,

    Check first these things

    1. Is your Sub report is running independently ?

    2. Are all the sub report parameter are available in Main report ?

    3.Is you refNum parameter is multivalue ?

    what is the default value you are passing to RefNum parameter in Main report.

    Hope this will help you !!!

    Monday, May 21, 2012 9:30 AM
  • Hi All, 

    Thanks for your responses, i did use the action to point it to the report.


    Firstly, my subreport is running independently without any issues coming to your second question do you mean all my sub report parameters should be available in main report as parameters (in my case one of them is not available as parameters but available as attribute in a dataset.)

    for your third question its a multivalue.

    Below are my main reports and one of the subreport

    Monday, May 21, 2012 2:03 PM
  • for more clarity i will upload the below image of my subreport which is popping up when i click the desired column in the main report

    here i am clicking Drg_Desc in the main report as soon as i click it, it do take me to the subreport but the parameters are not populated i dont understand what i am doing wrong.

    here in the first clip i am clicking on drg desc column, which will take me to the subreport 

    Below is the subreport which is not taking parameters into it, this is using ssas cube.

    earlier i developed same report with oltp as the source, but this time with ssas cube its not taking any parameteres into it.

    Monday, May 21, 2012 2:34 PM
  • Hi,

    You have to pass parameter to sub repor as a complete MDX expression like 

    “[Product].[Product].&”+Cstr(Parameters!ProductCategory.Value) + “]” above link by Lola Wang will solve your problem go these carefully

    Hope this will help you !!!

    Monday, May 21, 2012 5:26 PM
  • Thanks sanjeewan, but where should i pass this is it into is it into subreport dataset which pulls the data (sorry if being so silly)for the subreport. FYI the subreprot independently works fine except when linked with main report.

    Or do i need to set this in expression field of the underlined column textproperties window.

    Please comment, Thanks

    Monday, May 21, 2012 7:40 PM
  • Finally got it working, After reading number of blogs online i accidentally saw this article and modified the expression.

    First went to Actions in the text properties of that column and instead of passing member as parameter i choose fx FUNCITON (Click it)and i used "UniqueName" property as shown below it started working.

    • Marked as answer by SQLKiller Thursday, June 14, 2012 4:20 PM
    • Edited by SQLKiller Thursday, June 14, 2012 4:21 PM
    Thursday, June 14, 2012 4:20 PM