views:

2535

answers:

5

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?

Thanks

A: 

I have the same problem.

Greg Farquhar
A: 

Same problem...

We've added a reportviewer control to a page which is derived from a custom base form. On this base form we override the RenderChildren method. As example see article: http://msdn.microsoft.com/en-us/library/system.web.ui.control.renderchildren.aspx

We've had no problems with this prior to Beta 2, and our framework heavily relies on this functionality.

Steph
A: 

I'm having the same exact problem! I thought it was just me doing something wrong. Sadly, this is my first ever attempt to build a report in VS. Dangit!

When I trace through my method code, when it gets to the bottom, it just starts all over again at the top, like it's in some kind of refresh loop. I know that my DataTable has data because I can see it in the visualize of the debugger when stepping though.

Just for reference, here is my code:

protected void Page_Load(object sender, EventArgs e)
{
    busQuote quote = AceFactory.GetQuote();
    IQueryable<QuoteEntity> allQuotes = quote.GetAllQuotes();

    DataTable dtQuote = quote.Converter.ToDataTable(allQuotes, "Quotes");
    ReportViewer1.Visible = true;
    ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report1.rdlc");
    ReportViewer1.LocalReport.DataSources.Clear();
    ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Quote", dtQuote));
    ReportViewer1.LocalReport.Refresh();
}
MattSlay
WOW!! I kept playing around with this, and I moved the code out of my Page_Load() method and into a command button on the form, and now when the form comes up, the report is empty, but when I click the button the same exact code now works fine! Go figure.
MattSlay
A: 

I had this same issue and MattSlay's answer made me realize the Refresh method has to be called only when the page is not a postback, my working Page_Load:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            MainReportViewer.ProcessingMode = ProcessingMode.Remote;
            string reportName = this.Request.QueryString["ReportName"];
            MainReportViewer.ServerReport.ReportPath = "/Pulse Reports/" + reportName;
            MainReportViewer.ServerReport.ReportServerUrl = new Uri("http://10.1.0.48/ReportServer");
            MainReportViewer.ServerReport.Refresh();
        }
    }
Jon Atkins
+2  A: 

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.

Hobo Spider
Perfect blog post! That was the solution. +1 for the link.
NLV
Could you mark this as the accepted solution then? :)
Hobo Spider