SSRS multi-value parameter using a stored procedure

后端 未结 5 1758
长情又很酷
长情又很酷 2020-11-27 05:51

I am working on a SSRS report that uses a stored procedure containing a few parameters. I am having problems with two of the parameters because I want to have the option of

5条回答
  •  时光说笑
    2020-11-27 06:23

    Let us assume that you have a multi value list @param1

    Create another Internal Parameter on your SSRS report called @param2 and set the default value to:

    =Join(Parameters!param1.value, 'XXX')
    

    XXX can be any delimiter that you want, EXCEPT a comma (see below)

    Then, you can pass @param2 to your query or stored procedure.

    If you try to do it any other way, it will cause any string function that uses commas to separate arguments, to fail. (e.g. CHARINDEX, REPLACE).

    For example Replace(@param2, ',', 'replacement') will not work. You will end up with errors like "Replace function requires 3 arguments".

提交回复
热议问题