Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebForm.ReportViewer Infinite Loop Issue

I have a strange problem in Visual Studio 2010 (C#) using the Report Viewer to load an RDL file.

I use the following code to load the RDL:

        //get the data set and then 
        //.
        //.
        //pass the report to the viewer            
        using (FileStream stream = new FileStream(_AccessReportDocument.FileName, FileMode.Open))
        {
            this.AccessReportViewer.LocalReport.LoadReportDefinition(stream);
        }
        this.AccessReportViewer.LocalReport.Refresh();

The issues is that once piece of code above reaches the last line, the code jumps to the page's Unload Method and then back to this.AccessReportViewer.LocalReport.Refresh(); i.e. an infinite loop. Has anyone experienced this before? I have read that there are issues with the report viewer for vs 2010 but mainly with setting parameters, something I am not trying to do yet....

Debugging shows that all data sets etc are retrieved fine - so this is not the issue.

like image 910
user559142 Avatar asked Dec 06 '22 17:12

user559142


1 Answers

This can occur with VS2010 if you are not checking for postbacks when setting the datasource. This is because of the changes made to the report viewer to load data asynchronously. Full explanation here:

Reports Never Stop Loading With VS 2010

like image 177
Ira Rainey Avatar answered Dec 27 '22 16:12

Ira Rainey