Multi-value parameters in VS 2015 SSRS reports

  • Just came across a weird problem with VS2015 SSRS reports.Back in the day when I wrote a report in VS2008 with multiple values for aparameter, the value(s) would get passed fine as a comma delimited string. Justbreak the string up, no problem. Today I came across two issues in a VS2015created report. First, when I select multiple values for a parameter the variablename disappears from the query request. Second, when I select multiple valuesrather than having a delimited string, I get N''2016'',N''2015'' representingtwo years that need to be part of the query.

     

    So with multiple parameters, the query looks like this:

    exec sp_executesql N'FixedAsset_By_DepartmentN''2016'',N''2015'', @dept',N'@dept nvarchar(5)',@dept=N'15000'

     

    Without multiple value parameters, it looks like:

    exec sp_executesql N'FixedAsset_By_Department @yr,@dept',N'@yr nvarchar(4),@dept nvarchar(5)',@yr=N'2016',@dept=N'15000'

    Any thoughts?

  • Thanks for finding that. As soon as I opened the link I remembered doing that very thing oh so many years ago 🙂

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply