Can I pass a paramter to the Subreport ReportName field using SSRS 2008 R2?
Hello, I have a main report that would contain dozens of subreports, all of them with the same parameters and size. I will have a Report Name parameter that will specify what report should be displayed. How can I pass the Subreport name as a variable depending on the choice? This would allow to only do it once in the main report instead of being so repetitive not easy to maintain if/when something changes. Thanks in advance for your help/suggestions. Vanessa
November 9th, 2011 8:01pm
When you call a Sub-Report from a Report, you definitely have an option to pass parameter. Give the Report Name parameter in the textbox where you give the Sub-Report name. It will choose the Sub-Report based on the Report Name.Bunch of thanks ~ Deva ~ mark it as answer if it answered your question :)
November 10th, 2011 5:32am
Hi Vanessa, As devanathan suggested, there is a provision of passing parameter along with report name inside reports. Can you provide more details on the text when you say, "How can I pass the Subreport name as a variable depending on the choice?" Regards, Manoj *Happy to help http://experiencingmsbi.blogspot.com/
November 10th, 2011 6:16am
Hi, I would like to know how can I pass the Sub Report Name, this way I only need to have one subreport object in the main report. Once the subreports have the same parameters I only need to have the Report Name that will be called. Thanks in advance for your help, Vanessa
November 10th, 2011 5:46pm
Hi Vanessa, As you said, it is very tiresome to maintain the main report if some subreports name were changed. In your case, I think that we can try to specify the available values with other alias for the parameter. Then, we can use the parameter to control the visibility of the subreprots based on the user selection. Regards, Bin Long Please remember to mark the replies as answers if they help and unmark them if they provide no help.
November 16th, 2011 3:31am
1) Yes you need to have your sub-report name fixed so as to call from main report (without changing any value in main report) 2) to dynamically call a subreport from main report use the expression tab in the subreport item (in main report) whose output will be the required subreport name ** you can use a switch or case statement in the expression to evaluate the subreport name.
November 16th, 2011 6:37am
How can I do that? I don't see where I can have an expression for the report name. I really would like to have the name dynamically set. The Report Name is chosen from a parameter that is from a dataset with all the names of all available reports. I would like to be able to display the report based on the report chosen by the user without having to add dozens of Subreport objects in the main report and have to deal with the hide/display property and still being able to use the same Header and Footer. This way, the subreports on contain the detail part that will be displayed inside the main report. I'm using SSRS 2008 R2 and the report will be displayed in a dashboard not sharepoint. Thanks a lot for your help.
March 12th, 2012 5:33pm
Have you manged to resolve this. If so can you please let me know.
May 30th, 2012 7:56am