how to pass parameter to ssrs main report and sub report?
Hello there, I have a main report and a sub report in SSRS 2008 R2 that both get same set of parameters from their datasets and their datasets are both stored procedure. Say I have Main.rdl with @param 1, @param2, @ param3.Those parameter belong to the stored procedure that I used as dataset for my Mainrdl. I have Sub.rdl that also uses sproc as dataset with the same parameter belong to sproc (parameters are all the same and get the same value but values are not statice). because those parameters value will be provided at run time I need to know is there any way that I can pass value to both Main and sub at the same time? Thanks
Since the Main Report Parameters and Sub-report parameters have the same name, you just need to map the sub-report parameters with the respective Main report parameters values. For e.g. for first parameter @param1 Right Click the Sub-Report -> Click Sub-Report Properties -> Click Parameters -> Click Add -> Put param1 in the Name column and put [@param1] (I guess) in the Value column. Same needs to be done for the rest of the parameters. For more details, here is the link to BOL, where the key part of having the same parameter names is already done by you. [How to: Add a Subreport and Parameters (Report Builder 3.0 and SSRS)] :