How to pass a report parameter with multiple values from

Zansheen 21 Reputation points

I am currently using Visual Studio 2013 and I am writing a service that will allow someone to choose report settings and pass them into the SSRS 2016 report.
I am coding this is

The issue I am having is one report parameter has been setup to allow multiple values.
The multi value parameter works fine from SSRS.
Once I try to pass in a string from though it errors out if it has more than one value in it.
If you pass in "P1" for instance it works fine but, if you pass in "P1, P2" you get the following error. This report requires a default or user-defined value for the report parameter '<ParameterName>'. To run or subscribe to this report, you must provide a parameter value.

I have looked up several forum posts about split it in to a list of strings or to an array and neither have worked.
I get an error saying you cannot convert the "ListOfStrings" to a ParameterValue or something Similar

If you need more info just let me know :).
Any Help would be appreciated. Thanks.

An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,628 questions
0 comments No comments
{count} votes

Accepted answer
  1. Xingyu Zhao-MSFT 5,356 Reputation points

    Hi @Zansheen ,
    In order to pass multi value parameter to SSRS, you can try the following code.

        Dim rptParams As List(Of ReportParameter) = New List(Of ReportParameter)()  
        Dim param As ReportParameter = New ReportParameter("ParamName")  
        Dim values As String() = New String() {"P1", "P2"}  

    Hope it could be helpful.
    Besides, if I have any misunderstanding, please provide the code you've tried.

    Best Regards,
    Xingyu Zhao
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful