Search code examples
vb.netreportviewer

Is it possible to display different reports with a single a report viewer?


Is it possible to display different with a single a report viewer such that when I click on the button "Report 1" to should display Report 1 in the Report Viewer.

If I click on the button "Report 2" it should display Report 2.

Is this possible ? If yes then please provide the code.

EDIT 1 :

I tried it like this, its not working

    frmReport.ReportViewer1.Reset()
    frmReport.ReportViewer1.LocalReport.ReportEmbeddedResource = "sdvsdf.Report1.rdlc"
    frmReport.ReportViewer1.RefreshReport()

Solution

  • You can change the source of the report using the ServerReport or LocalReport properties on the ReportViewer object, depending on whether you're sourcing your reports from a SSRS server or are using local .rdlc files.