none
Multivalued parameters Issue RRS feed

  • Question

  •    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    
            Dim rpt As FormReports = New FormReports
            rpt.ReportViewer1.ServerReport.ReportPath = "/rIssueTrackingv2"
            Dim p As New Generic.List(Of ReportParameter)
            Dim p1 As New Generic.List(Of ReportParameter)
            Dim p2 As New Generic.List(Of ReportParameter)
            For i As Integer = 0 To TypeCheckedListBox.CheckedItems.Count - 1
                Dim Type As String = TypeCheckedListBox.CheckedItems(0)
                p.Add(New ReportParameter("Type", Type, False))
            Next i
            For i As Integer = 0 To StatusCheckedListBox.CheckedItems.Count - 1
                Dim Status As String = StatusCheckedListBox.CheckedItems(0)
                p1.Add(New ReportParameter("Status", Status, False))
            Next i
            For i As Integer = 0 To PriorityCheckedListBox.CheckedItems.Count - 1
                Dim Priority As String = PriorityCheckedListBox.CheckedItems(0)
                p2.Add(New ReportParameter("Priority", Priority, False))
            Next i
            rpt.ReportViewer1.ServerReport.SetParameters(p)
            rpt.ReportViewer1.ServerReport.SetParameters(p1)
            rpt.ReportViewer1.ServerReport.SetParameters(p2)
            rpt.ReportViewer1.RefreshReport()
            rpt.Show()
        End Sub

    The code above works when selecting a single parameter from each check list box, but I need it to work with 2 or 3 or 5 selected from each check list box. The error I am receiving when selecting multiple types  is: "Parameter 'Type' was specified multiple times"

    same error just with different name for Status and Priority

    Thursday, May 23, 2013 1:57 PM