Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In VS2010 Beta 2, the Web Report Viewer does not display the content of the report

In VS2010 Beta 2, the Web Report Viewer does not display the content of the report, whether I use Local or Remote mode.

It only display the following "disabled" bar [image]

The report I created works fine in the Report Server.

Here is the code for displaying the report:

        ReportViewer1.ProcessingMode = ProcessingMode.Remote;
        ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/reportserver");
        ReportViewer1.ServerReport.ReportPath = "/MyReports/Report1";
        ReportViewer1.ServerReport.Refresh();

Or

        ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local;
        ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report1.rdlc");
        ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", myDataSet);
        ReportViewer1.LocalReport.Refresh();

And I've already added the ScriptManager to the webpage, and the corresponding handlers entries in the web.config (both in system.web and system.webServer section).

The same code works fine in VS2008.

Anyone encountered the same issue?

like image 547
Nan Li Avatar asked Nov 20 '09 18:11

Nan Li


2 Answers

Prior to Beta 2, VS came loaded with Report Viewer 9.0 (same as in VS 2008). Beta 2 uses Report Viewer 10.0 which handles asynchronous rendering differently (using ASP.Net AJAX vs. rendering content in an iframe). Is the reportviewer showing the loading indicator indefinitely? If so, then you probably have some code in your page's load event that is telling the ReportViewer to restart report processing. If you do this every postback then the viewer gets stuck in an infinite loop. Simply adding a check of IsPostBack to your page's load event should fix this problem.

For more, see "Reports Never Stop Loading With VS 2010" in Brian Hartman's Report Viewer Blog.

like image 143
Hobo Spider Avatar answered Oct 23 '22 01:10

Hobo Spider


just use

if(!isPostBack)
{
//your code here
}

to avoid ReportViewer infinite loading loop with reportviewer version 10.0.0 and VS2010 and using SSRS2008

like image 2
Rashmi Kant Avatar answered Oct 23 '22 01:10

Rashmi Kant