sqlreporting-servicesparameter-passingmultivalue

Do we have option to pass multi value parameter from main report to sub report in SSRS?


I want to pass multi value parameter from main report to sub report, Is there any option do so in SSRS?


Solution

  • Yes, there are a few ways to do this.

    1. Pass a multi-value parameter directly from the main report to the subreport. For example, if your user chooses "Apples" and "Oranges" in the main from a parameter called pCategory then you can simple pass this parameter to your subreport and both values will be passed.
    2. Pass a literal list of string values. If you want to hardcode a list of parameter values then you can use the SPLIT() function. e.g. =SPLIT("Apples,Oranges", ",") . Using this expression as the subreport's parameter value will split the string into an array and pass it to the subreport.
    3. As above but dynamic. You can use an expression to build is the list of values you want to pass and replace the literal in example 2 above.