Report Viewer Toolbar does not render properly on IIS 7.0

Report Viewer Toolbar does not render properly on IIS 7.0

  • Comments 42

I was recently working on a reporting web application that uses the Report Viewer ( ReportViewer ) control that ships with SQL Server Reporting Services (SSRS). The Report Viewer control was rendering perfectly when I was developing using Visual Studio 2008. The trouble started when I published the web application to an IIS 7.0 server. The Toolbar was completely broken and showed up something like this.

SSRStoolbar

<rsweb:ReportViewer AsyncRendering="false" ID="reportViewer" Width="100%" Height="100%" runat="server" SizeToReportContent="True" > </rsweb:ReportViewer>

Initially it looked like just the images where missing. But the toolbar was completely broken. The toolbar of the Report Viewer control relies on images and JavaScript that are generated dynamically. It uses a call to the Reserved.ReportViewerWebControl.axd to dynamically generate the images and the JavaScript. Something like

GET /Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=9.0.30729.1&Name=Microsoft.Reporting.WebForms.Icons.NextPage.gif HTTP/1.1

GET /Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=9.0.30729.1&Name=Microsoft.Reporting.WebForms.Icons.LastPage.gif HTTP/1.1

When you use the Report Viewer Control Visual Studio edits your web.config to map a Http Handler to respond to these requests.

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

The above entry tells ASP.NET that whenever a call is made to ReportViewerWebControl.axd use the Microsoft.Reporting.WebForms.HttpHandler assembly to execute it.

This mapping is very important because if you remove it the web server will return a 404 “File Not Found” error code because the ReportViewerWebControl.axd does not exist physically on the server.

Strangely when I checked the IIS 7.0 logs for the broken scenario I found that all requests for ReportViewerWebControl.axd had failed with a 404.

With IIS 7.0 there was an architectural change. There were changes to the web.config structure as well. The <httpHandlers> section that was under the <system.web> has now moved to <handlers> under <system.webServer>

Visual Studio had edited the web.config based on the IIS 6.0 model and had made an entry for the Http Handler under the <httpHandler> section. With IIS 7.0 this section is no longer read. So we need to make the proper entries for the Http Handler that handles the calls to ReportViewerWebControl.axd

<system.webServer>
    <handlers>
    <add name="ReportViewerWebControl" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </handlers>
</system.webServer>

IIS 7.0 will now understand that whenever a call is made to ReportViewerWebControl.axd it needs to route it to the Http Handler Microsoft.Reporting.WebForms.HttpHandler


Bookmark and Share

Leave a Comment
  • Please add 6 and 1 and type the answer here:
  • Post
  • Great Help maan .... tahnks a toN :)

  • This is a great work.Thank for this

  • Very cool solution... Tnx buddy....

  • After do it, I receive a another error:

    500 - Internal server error.

    There is a problem with the resource you are looking for, and it cannot be displayed.

  • After doing steps above my report is still not working.  Please let me know what did I missed? Thanks.

  • Friend, I have to thank you because you saved my life!! I was having a big problem to render the reportviewer version 9.0 in IIS 7.5, IIS 6 could usually, but not working in IIS 7.5.

    When I added the tag described by you in <handlers> everything was resolved.

    Thank you very much.

  • I have SQL Server 2012 and Microsoft SQL Server Reporting Services Version 11.0.3000.0

    I had the issue with IE stating "unable to load client print control"

    In Visual Studio 2010 using c# for the web site I had to change the following handler from "false" to "true" and then it worked!

       <httpHandlers>

         <!--

           Note: DRK had to change the line below from:

           validate="false" />

           to validate="true" />

         -->

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

       </httpHandlers>

    Contact me at rdkram@gmail.com

  • You are friggin awesome.  This worked like a charm.

  • In case the above answer doesn't solve it for you....

    I had the same issue when upgrading from version 9 to 11 report viewer. After trying everything above I remembered having to add script manager to my aspx on upgrade. I have had this issue with on another site using script manager so added the following to web.config

    <system.webServer>

     <handlers>

    ...

       <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd"

    type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

    ...

     </handlers>

    </system.webServer>

  • Check the application pool of the website. it should be class.net if you are using RLDC report viewer.

  • Thanks alot, this works like charm.

  • Great help! Worked for me. As someone else said, the pic at the top of the blog with the broken toolbar is a gem - you instantly know this iw what you're looking for. Thanks.

Page 3 of 3 (42 items) 123