Search code examples
reporting-servicesparameter-passingssrs-2008ssrs-2012

Chose two options in multi-value parameter but pass one value


I am new using multi-value parameters so i have a question about this. My dataset is using a procedure and the value that i have to pass in the procedure are handled in the parameter Include Period and it has two options: Compulsory and Post Compulsory. If you chose Post-Compulsory label the value passed in the SP would be "Showing payments only after the compulsory period" , if you chose Compulsory label the value passed in the SP would be "Showing payments during the compulsory period only" and if you chose both options the value passed in the SP would be "Showing payments during the compulsory period and after". So i don't know if there is a way to do that. I set the configuration in available values: [1]: https://i.sstatic.net/h9UT5.png But i don't know if is posible to configure one value for two different labels.

Notes:

  • I can't change anything of the SP

If anyone could help me I would be very grateful


Solution

  • How about a Third Option?

    It would be much easier to change your parameter to NOT be multi-value and add a third option with both and the value for showing all.

    Compulsory and Post Compulsory | "Showing payments during the compulsory period and after" 
    

    If, for whatever reason, you're not able to do that, you could count the parameter and if two are selected then use the custom value in the Dataset's expression builder.

    ="EXEC MY_SP @PERIOD = '" & 
        IIF(Parameters!PERIOD.Count = 2, "Showing payments during the compulsory period and after", Parameters!PERIOD.VALUE(0)) & "'"