This is a migrated thread and some comments may be shown as answers.

Using a ReportViewer for multiple reports

2 Answers 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bob Bruce
Top achievements
Rank 1
Bob Bruce asked on 10 Dec 2009, 12:25 PM
How, in VB.Net, can I assign different reports to a ReportViewer?   I can create a viewer for each report, but that seems very inefficient.

Any help is appreciated.

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 10 Dec 2009, 06:04 PM
Hello Bob,

You simply use the Report property of the viewer to change the assigned report e.g.:

Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As EventArgs)
    Dim rpt As Telerik.Reporting.Report
    Select Case DropDownList1.SelectedItem.Value
        Case "1"
            rpt = New Report1()
            Exit Select
        Case "2"
            rpt = New Report2()
            Exit Select
        Case "3"
            rpt = New Report3()
            Exit Select
    End Select
End Sub


All the best,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Bob Bruce
Top achievements
Rank 1
answered on 10 Dec 2009, 08:00 PM
Works great.  Thanks.
Tags
General Discussions
Asked by
Bob Bruce
Top achievements
Rank 1
Answers by
Steve
Telerik team
Bob Bruce
Top achievements
Rank 1
Share this question
or