Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Passing Single value and Multi value parametes to SSRS report server from asp.net

$
0
0

Hi,

  I have been struggling with this for the past 4 days. I tried all possible solutions from different forums. I do have two parameters in the reports. The first one can accept a single value and second parameter accepts multiple values. I have set the 2nd parameter as multi value parameter and its expression as Join(Parameters!Route.Value,","). For some reason I get the error message “Parameter “Route” is missing its value”.  Here is my code

If Not ((ddlLocation.SelectedValue = "") Or (chkMultipleRoutes.SelectedValue = "")) Then
            'Dim SelectedRoutes As New List(Of String)
            Dim myAL = New ArrayList
            Dim Routes As New List(Of String)
            myAL.Add(ddlLocation.SelectedValue)
            For i As Integer = 0 To chkMultipleRoutes.Items.Count - 1
                If chkMultipleRoutes.Items(i).Selected Then

                    'txtSelectedRoutes.Text += chkMultipleRoutes.Items(i).Text + "','"
                    myAL.Add(chkMultipleRoutes.Items(i).Text)

                    txtSelectedRoutes.Text += chkMultipleRoutes.Items(i).Text + ","
                    txtSelectedRoutes_PopupControlExtender.Cancel()

                End If
            Next



            Dim reportParameterCollection As ReportParameter() = New ReportParameter(1) {}
            reportParameterCollection(0) = New ReportParameter()
            reportParameterCollection(0).Name = "LocationID"
            reportParameterCollection(0).Values.Add(ddlLocation.SelectedValue)

            reportParameterCollection(1) = New ReportParameter("Route", CType(myAL.ToArray(GetType(String)), String()))



            ReportViewer1.Visible = "True"
            ReportViewer1.ProcessingMode = ProcessingMode.Remote
            ReportViewer1.ServerReport.ReportServerUrl = New Uri("http://test/ReportServer_RPT")
            ReportViewer1.ServerReport.ReportPath = "/ReportTest"

            ReportViewer1.ServerReport.SetParameters(reportParameterCollection)
            ReportViewer1.ServerReport.Refresh()

 

 


 I really appreciate any help this. What is that I am doing wrong here?

 

 

 

 

 

Thanks

 

ylsv



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>