locked
Using Report Parameters to pass data from a subreport to the main report? RRS feed

  • Question

  • I am creating a report where I need to use a subreport to pass data to the main report from a different dataset than the main report is using, I need to have the data from the subreport grouped on a field from the main report which is using a different dataset. I think I need to use a Report Parameter to do this but am struggling with figuring out how to set the parameter correctly. any useful advise would be appericated.
    Stacey P. Shoemaker
    Monday, November 1, 2010 10:38 PM

Answers

  • someone has helped me with this problem, and I understand what I was doing wrong.

     

    thanks for trying to help...


    Stacey P. Shoemaker
    • Marked as answer by Shoey77 Wednesday, November 3, 2010 3:32 PM
    Wednesday, November 3, 2010 2:40 PM

All replies

  • In the parameters section of the subreport properties (Right click the subreport in designer and click properties), you would enter MyParameter and set it's value to either a field or a parameter in the main report..

    Tuesday, November 2, 2010 12:39 AM
  • thank you for answering Josh, the mechanics of setting the parameter is the easy part, my problem is that when I set the value to a field from the dataset of the main report the subreport doesn't work, if I set the value to a field from the subreports dataset, it works but it useless because it doesn't display the correct data.
    Stacey P. Shoemaker
    • Proposed as answer by Suman Sarkar Wednesday, November 3, 2010 3:14 PM
    Tuesday, November 2, 2010 2:14 PM
  • Hi Stacey

    'When I set the value to a field from the dataset of the main report the subreport doesn't work' - I'm assuming this is what you want to do, set the value of the subreport parameter to a value sourced from a dataset in the main report.

    Can you please expand on 'doesn't work' as we need more information to help you fix this.

    Do you receive an error message when the subreport rendering fails - also can you please post the SQL/MDX from both the main report dataset you are sourcing the parameter value from, and also the body of the subreport dataset.

    Also please post the definition of the parameter in the subreport.


    Cheers

    • Marked as answer by Shoey77 Wednesday, November 3, 2010 3:32 PM
    • Unmarked as answer by Shoey77 Wednesday, November 3, 2010 3:32 PM
    Wednesday, November 3, 2010 5:55 AM
  • someone has helped me with this problem, and I understand what I was doing wrong.

     

    thanks for trying to help...


    Stacey P. Shoemaker
    • Marked as answer by Shoey77 Wednesday, November 3, 2010 3:32 PM
    Wednesday, November 3, 2010 2:40 PM
  • I am also having the same problem. I have set the parameter in the subreport to a field from the main report. I was able to do this becuse i have added the main dataset to the subreport.

    The error I get is "The subreport 'SettlementInc=voiceDoc could not be found at the specified loaction 'SettlementInvoiceDocuementReport.rdlc. Please verify that teh subreport has been published and that tahe name is correct."

     

    The result is that teh main report comes up with data but the subreport shows an error.

     

    Please assist me what I am doing wrong. I have spent 4 days to get this resolved.

    Thank you

    Monday, November 8, 2010 9:00 PM