reportviewer whit differents reports

I wonder if is possible to use une ReportViewer an dinamically change the report it show.

if so, please tell me any indication.

Thanks




Answer this question

reportviewer whit differents reports

  • Mark McCasland

    Are you saying that calling ReportViewer.LocalReport.LoadReportDefinition does not work in Local mode in Webforms


  • IGeorgeI

    Thanks.

    Im using windows forms and the Reset way is working fine now for me.

    Thanks again.



  • Tomas Kiss

    Calling LoadReportDefinition will work the first time it is called, but it will not overwrite a definition that has already been rendered.
  • adamcalderon

    In server mode, just set a new report path and you are all set.

    In local mode, things are a little more complicated due to some limitations of the LocalReport object. Using the winforms control, you can call ReportViewer.Reset to allow you to supply a new local report definition. Unfortunately in webforms, there is no reset method (it's a bug). So in webforms local mode, you need to instantiate a new instance of the viewer to change definitions.


  • Roger_Wagner

    Brian,

    This  why changing the ReportPath doesn't work

    Do have to dispose the object and create a new object

     

    From other message I posted...

    Any idea why or how, the following code from a combobox doesn't cause the reportviewer control to render with the newly selected local report file

    private void cbxReports_SelectedIndexChanged(object sender, EventArgs e)

    {

    string fullName = ((FileInfo)cbxReports.SelectedValue).Name;

    ReportViewer1.LocalReport.ReportPath = Application.StartupPath + "\\Reports\\" + fullName;

    ReportViewer1.LocalReport.Refresh();

    this.ReportViewer1.RefreshReport();

     

    }

    With thanks,

    Gavin :)


  • Chandra.Sekhar

    Hello,

    I would like to do the same, using one reportviewer to display all reports i have on my project. I'm starting to learn VB and i'm a bit lost.

    Could somebody post some sample code how to do this programatically in VB

    Regards.



  • Sunny Boy

    just call viewer.Reset() before changing the rdlc.


  • reportviewer whit differents reports