locked
Report Viewer shows blank page - only some reports RRS feed

  • Question

  • User853069572 posted

    I hope someone can help me.  I've been struggling with this issue for a couple of days.  Any guidance will be appreciated.

    I have an ASPX page with a ReportViewer component. Basically that's all there is on the page (the ASPX is included further down).  This is served on IIS 7.5 on a Windows Server 2003 box.

    I have 3 reports that I can view from this page.  The first report always works - the full report renders and the control buttons (export, print, next page, etc) all work fine.

    However, on the other 2 reports I get a blank page rendered.  Nothing is visible at all except for the scrollbar.

    A bit bizarre because the first report does show correctly.  Only the other two reports don't show.

    So, I thought that maybe there was something wrong with the report files themselves - like another error can't be reported on screen for some reason.  But I am able to render those reports directly via the SSRS management web.  This screen below is one of the ones that fails via ReportViewer but works just fine in the SSRS management website.

    working report preview

    I did go through other posts like these (http://forums.asp.net/t/1388924.aspx?ReportViewer+showing+an+Empty+report+on+Windows+Server+2008 and http://stackoverflow.com/questions/16607184/reportviewer-control-returns-blank-page) , but the config issue they described isn't a problem because one report does work.  And I tried all of the combinations of config they describe - classic mode / integrated and even 32-bit / 64-bit.  Broke it a few times (so that none worked), fixed it a few times (so that 1 out of 3 worked), but no closer to a fix for all reports.

    Please help.  I've removed and added the site, changed the config many times, tried different pipeline modes in the app pool, re-installed the report viewer redistributable.  I'm not sure what else to try.

    SimpleReportView.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="SimpleReportView.aspx.cs" Inherits="SimpleReportView" %>
    
    <%@ 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>Report Viewer</title>
        <style type="text/css">
            h2 {
                font-size: 14pt;
                font-family: Calibri, 'Microsoft Sans Serif', 'Open Sans', sans-serif;
                font-weight: bold;
            }
    
            #divErrorDetails {
                font-size: 11pt;
                font-family: Calibri, 'Microsoft Sans Serif', 'Open Sans', sans-serif;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

    <div id="divReportViewer" runat="server" style="display: block;"> <rsweb:ReportViewer ID="rvMain" runat="server" ProcessingMode="Remote" Width="100%" Height="700" ShowExportControls="True" ShowFindControls="True" ShowParameterPrompts="False" ShowPromptAreaButton="True" ShowRefreshButton="True" BackColor="White"> <ServerReport DisplayName="MainReport" Timeout="60000" /> </rsweb:ReportViewer> </div> <div id="divError" runat="server" style="display: none;"> <br /> <br /> <h2>There was an error generating this report</h2> <div id="divErrorDetails" runat="server">Error details to go here</div> </div> </form> </body> </html>

     

    Web.config

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    <configuration>
      <connectionStrings>
      </connectionStrings>
      <system.web>
        <compilation debug="false" defaultLanguage="c#" targetFramework="4.0">
        </compilation>
        <httpRuntime />
        <pages>
          <namespaces>
          </namespaces>
        </pages>
        <authentication mode="Windows">
        </authentication>
        <globalization uiCulture="en-ZA" />
      </system.web>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
            <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
          </dependentAssembly>
          <dependentAssembly>
            <assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
            <bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_IWcfReportProcesses" />
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://servername/WcfReportProcesses.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IWcfReportProcesses" contract="ReportProcessesWcf.IWcfReportProcesses" name="BasicHttpBinding_IWcfReportProcesses" />
        </client>
      </system.serviceModel>
      <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>
        <modules runAllManagedModulesForAllRequests="true" />
        <validation validateIntegratedModeConfiguration="false" />
      </system.webServer>
    </configuration>
    
    



    Thursday, August 21, 2014 5:03 PM

Answers

  • User853069572 posted

    I have managed to resolve this issue. It was caused by a missing required parameter. The web page hosting the ReportViewer control was automatically mapping certain parameters to specific values, but in the case of the two failed reports, the reports shared a mapped parameter that was not setup correctly. The map worked on a dev server - a typical "it works on my machine" problem. Wink

    For anyone in future who might run into blank report problems, I hope that you find these investigation steps useful:

    1. Does the report render in SSRS Management website? Sometimes RDL errors generated by the server will not be shown on the client browser. If you browse to the report on the SSR management website and run it with test parameters, does it work? If not, the report will need to be fixed before trying from the ReportViewer component again.
    2. Is the correct version of the ReportViewer redistributable package installed on the web server? This you can check by opening "Programs and Features" in the Control Panel and looking for "Microsoft Report Viewer 20XX Runtime" (where 20XX is 2005, 2008, 2012, etc). In the "Version" column, check that the version number is greater than the version number declared in the web.config file (described below).
    3. Is the correct report path being used when setting the "ReportPath" property on the control? Is the "ReportServerUrl" correct? You can copy and paste these values together into a web browser to check.
    4. Are all non-nullable parameters being set in code before the report is rendered? If a parameter is not defined in the report designer with a default or if the parameter does not have the "Allow NULL value" flag set, then a value must be provided for every call.
    5. Is your website configuring for the correct version of IIS? There is a different way to configure the HTTP Handler depending on whether the server is before version 7 or is version 7+. (Note: these example configurations are for the report viewer 2012. Other versions have different Version Numbers, different Public Key Tokens and may need additional assemblies to be registered)
      • Is IIS 6 configured correctly? For IIS 6, the HTTP Handlers are defined in the <system.web> section of the config file as shown below.
        <system.web>
          <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>
      • Is IIS 7 configured correctly? For IIS 7, the HTTP Hanlders are defined in the <system.webServer> section of the config file as shown below. Take note that adding the <validation> in the config can help to find if the HTTP Handler is defined in the wrong place, IIS will generate an error 500 on any page in the site and the error will detail where the configuration is incorrect. This is also shown below.
        <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>
          <modules runAllManagedModulesForAllRequests="true" />
          <validation validateIntegratedModeConfiguration="false" />
        </system.webServer>
    6. Does the App Pool Pipeline Mode match the IIS configuration? If you have setup your App Pool to use "Integrated" mode, then you will need to use the IIS7 configuration described in point 5 above. If your App Pool Pipeline mode is set to "Classic" mode, then you will need to use the IIS 6 configuration described above.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 25, 2014 5:36 AM