none
multiple reports to reportviewer in web form RRS feed

  • Question

  • Is it possible to add multiple reports to single reportviewer in web form
    any suggestions please
    Thanks in advance
    dot net environment
    Thursday, January 8, 2009 7:28 PM

All replies

  • yes you can.

    Merely decide how/where you want to store your .rdlc files


    And everytime you want to change reports, call the clear methods for the datasources.

    ReportViewer1.Localreport.Dataources.Clear();

    Load the appropriate report by using something like

    ReportViewer1.Localreport.reportpath =  Server.MapPath("/ReportFolder/" + reportname);

    Load appropriate datasources

    ReportDatasource  rpData = new ReportDataSource();
    rpData.Name =  "RequiredDatasourceForThisReport";
    rpData.Value =  dtDataTableWithDataAlreadyInIt;

    ReportViewer1.Localreport.Datasources.Add(rpData);



    refresh the viewer.

    ReportViewer1.Refresh();


    That's basically the steps, I may of forgot a step here or there, but give it a whirl.


    Living my life at 123mph in 11.15 seconds
    Thursday, January 8, 2009 7:46 PM