17
votes

I have a web form containing a ReportViewer control, a DIV element so I can see that the page actually renders. I see that my page properly loads, I see the report service being accessed in Fiddler, but there is never anything displayed.

At present, I'm using a report with static text, no queries on it, in order to ensure that I isolate the issue.

My page is as follows:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="PeopleNet.Web.Views.Reports.ReportViewer" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Path="~/scripts/jquery-1.7.2.js" />
                <asp:ScriptReference Path="~/scripts/fixReportViewer.js" />
            </Scripts>
        </asp:ScriptManager>

        <div>
            This is the report viewer page...
        </div>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server"></rsweb:ReportViewer>
    </form>
</body>
</html>

The code to display the report is:

protected void Page_Load(object sender, EventArgs e)
{
    this.ReportViewer1.ServerReport.ReportServerUrl = ConfigurationFacade.ReportServerUri;
    this.ReportViewer1.ServerReport.ReportPath = { path to report name };
    this.ReportViewer1.ServerReport.ReportServerCredentials = new ReportServerCredentials(); // custom class implementing IReportServerCredentials as described in various places around the web, including SO
    this.ReportViewer1.ServerReport.Refresh();
}

My web.config file is configured with the HttpHandlers as required:

<system.web>
    <!-- abbreviated... -->
    <httpHandlers>
        <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" validate="false" />
    </httpHandlers>
</system.web>

And :

<system.webServer>
    <!-- abbreviated... -->
    <handlers>
        <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>
</system.webServer>

The server runs Windows 2008 and SQL Server 2008 R2.

I am using the SQL Server 2012 version of the viewer, as we are in the process of updating our environments to 2012.

I have repeatedly verified that the report is accessible from the ReportManager, with no issues whatsoever.

I have been attempting to access this in IE9, having seen various issues stated with other browsers.

I am presently (for testing only) passing my credentials as the report server credentials. I am a Reporting Services Administrator, as well as a member of the server administrators group on the server.

I have checked both the event log and the ReportServerService log, and have found nothing amiss.

UPDATE: Looks like when change the AsyncRendering to false, and ensure that I don't try to "SetParameters" with an empty collection, this gets mostly cleared up:

this.ReportViewer1.AsyncRendering = false;

What am I missing in the configuration/code here?

5
Just a silly check/question: have you checked this with a new, basic (e.g. just a textbox with hardcoded text) report as well? Also, can you add which version of the ReportViewer controls you're using? - Jeroen
Yes, at present, I'm using a simple page with static text on it, just to ensure that I can isolate the issue. - reallyJim
Do you still have a problem, or does your update mean that you've resolved it? - Ann L.
"Resolved" is a loaded term here. It's working, but everything about it feels a bit too hack-y. What's async for if I can't use it? Why can't I SetParameters with an empty list? (leaving out whether or not that's a good idea) - reallyJim
Try the same report but this time, add it to your VS project and use it as a LocalReport -- does it work? - udog

5 Answers

4
votes

My solution to this issue was related to trying to set the report viewer height to 100%. This resulted in no report showing. Changing the height to a px value (ie 900px) got the reportviewer working.

1
votes

There is this blog entry on MSDN that discusses how asynchronous rendering works.

Additionally, it mentions that (as was said in the comments) synchronous rendering embeds the content in the page, while asynchronous rendering renders the content in a frame. The size of the frame is "difficult...to calculate" and the SizeToReportContent property is ignored.

Since your report won't display unless it is synchronously rendered, the issue must be in the use of frames.

In the article mentioned in the comments, asynchronously rendering the report will collapse the control height to zero pixels if a relative height is used. This could explain why nothing is displayed. You might try specifying a height for the control. There are other suggestions in that article as well.

That's assuming that your issue is in the SQL Server 2008 R2 SSRS version, which I believe draws from VS 2008. SQL Server 2012 SSRS I think draws on VS 2010, which is not supposed to have those issues, so when you finish your upgrade, this issue might go away.

1
votes

I had exactly the same symptom: A report was rendered with a completely blank page. For me that was the case in production, but it worked in development environment.

The report had two parameters and in the RDL both without having default values specified. When calling the report in the aspx code behind I had accidentally passed only one parameter. The second parameter had a default value set on the Report Server of the development machine but not in production. (Yes, the Report Server allows to specify parameter defaults independently from the default settings in the RDL file.) As a result the report rendered in development but not in production.

I found this by looking at the response XML with Fiddler. It contained an element telling me that a parameter value was invalid. Unfortunately the Report Viewer itself doesn't show any error message about the missing parameter and just displays a blank page - which makes the root of the problem difficult to find.

0
votes

My report was showing blank as well. I played with the properties and it finally showed up.

Changing the ProcessingMode property on the ReportViewer control in the aspx page worked for me:

<rsweb:ReportViewer ID="ReportViewer1" runat="server" 
    Width="100%"  ProcessingMode="Remote">
</rsweb:ReportViewer>

This is what I have:

<rsweb:ReportViewer ID="ReportViewer1" runat="server" ZoomMode="PageWidth"
    Font-Names="Verdana" Font-Size="8pt" Width="100%" ProcessingMode="Remote"
    ShowParameterPrompts="False" ShowToolBar="True"  ShowCredentialPrompts="False" 
    ShowFindControls="False" ShowZoomControl="False" CssClass="ReportViewer">
</rsweb:ReportViewer>

web.config:

<configuration>
  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>

    <httpHandlers>
      <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
    </httpHandlers>

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      </assemblies>
    </compilation>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
    </authentication>
    <membership>
      <providers>
...
      </providers>
    </roleManager>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
  </system.webServer>
</configuration>
0
votes

There are several problems when you get blank reports:

  1. IIS Pipeline; IIS 6 vs IIS7 and above Make sure you have correctly registerd HttpHandler

IIS7 settings

    <system.webServer>
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>

More details

If missed the correct registration you can try to switch IIS application pool into Classic mode Managed Pipeline Mode

If your registration is Ok you should be able to use Integrated mode

  1. Another Handler interferes with ReportViewer

In my case it was Glimpse. Glimpse is a very powerful tool and it works fine together with ReporViewer on developer machine but it has problems on deployed customer server. Solution was easy, jst remove all glimse settings from web.config