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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With