I have a report in which the user can select multiple items in a list for one of the parameters. Clicking on the report opens a sub-report, with parameters being passed to the sub-report. If only one item is selected, then this works fine. If multiple items are selected, then only one item in the parameter list is passed to the sub-report.
The parent report works fine, the sub-report only shows the first item. I am using SSRS 2008 R2. How can I get the sub-report to accept all the items for the passed parameter?
A few things to check:
[@paramName]
and not "=Parameters!ParamName.Value(0)"
as this indicates to retrieve only the first value. =Split(join(Parameters!ParamName.Value,","),",")
which creates a comma separated list of the parameter values and then splits it out into an array.I use a workaround in sql for those, since it's a pain to use multiple parameters in ssrs. As mmarie says, start by concatenating the multiple values in the parameter (=Split(join(Parameters!ParamName.Value,","),",")) and then check the items in the subreport with a string comparison. It usually gives something like WHERE '%,'+subreport_item+',%' LIKE ','+parent_report_multiple_parameters+',' It's a quick dirty solution...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With