Report Viewer Toolbar does not render properly on IIS 7.0


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

Comments (43)

  1. Mark Sowul says:

    I miss the days when MS would bend over backwards for backwards compatibility – much less not making stupid breaking naming changes like this.  

  2. Andrei says:

    Create empty file in notepad

    and save it under the name

    Reserved.ReportViewerWebControl.axd

    into folder containing Web.config.

  3. Mike says:

    Your blog cuts off a large portion of the code can you please post an entry with the full code for the handlers?

  4. vijaysk says:

    Mike I have added scroll bars around the code block. Hope it helps.

  5. Mike says:

    Thanks.  I tried to drop that into my code but no fix.  I know it applied to IIS 7.0 & I am running IIS 5.1 on XPSP2 with VS 2K8 and I am still getting the same thing.  Thanks for the scroll bars guess I will be back to the drawing board till I find a fix… If you have any ideas as to why I am getting the same error but on a different platform please feel free to shoot me a message trigeek512 at gmail dot com! Thanks & keep up the good work.

  6. I was recently working on a reporting web application that uses the Report Viewer ( ReportViewer ) control

  7. Emil says:

    Thank very much. reslove my problem.

  8. Doni says:

    Thank you.  This solved my problem.

  9. Luis says:

    Thank you. Solved my problem 🙂

  10. Dennis says:

    I could reach through my monitor and kiss you!  Thank you! Thank you!  I’ve been scratching my head all day on this one.  The picture of the broken tool bar at the top was golden.  I knew when I saw it that this page would be the exact fix I needed.

  11. Sandra says:

    Thank you thank you thank you!!!!!!!   I have been practically banging my head against the desk over this problem.  Your solution was EXACTLY what it took to fix it for me also!

  12. Nav says:

    Hi.. I was experiencing the same problem of the missing icons and report not rendering with ReportViewer 8.0 connecting to SSRS 2008 and IIS7. The above fix didn’t solve the problem for me unfortunately. Does anyone think that the versions are incompatible…?

    Thanks in advance!

  13. Nav says:

    Fixed!! It was the missing ‘name’ attribute and offending ‘validate’ attributes in my entry that was causing the issue.

    So in conclusion, ReportViewer 8.0 does work with SSRS 2008 effortlessly!

    Great post .. many thanks!

  14. Nelson says:

    What a beauty. It just worked adding the comments.

  15. MeanYB says:

    Thanks so much!  You saved me hours of troubleshooting!

  16. Eric says:

    Can you think of any situations that would cause the same exact behavior even after following these steps?

    Our rdls have to remain as 2005 versions so all your steps were followed except the version is 8.0 instead of 9.0 everywhere in the web.config.

    This has worked in many prior installations on different customers, but this time it does not change things the images are still missing and the entire toolbar does not work because of JS errors.

    I have also run the Microsoft fix for the 2005 ReportViewer Redistributable on the web and report server boxes but that didn’t change the above either. (http://www.microsoft.com/downloads/details.aspx?familyid=82833F27-081D-4B72-83EF-2836360A904D&displaylang=en).

  17. PacMan X says:

    These suggestion are very usefull

  18. Yasir says:

    Wonderful. Report Viewer was giving headache on production host. Made that addition and it worked. Thanks

  19. Arshika says:

    Heelo,

    I have developed RDLC report that can export in pdf and excel in mozila but not in IE. In IE give a following error.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /Reserved.ReportViewerWebControl.axd

  20. Juan Petrone says:

    Thank you SO Much, this was driving me crazy

  21. Peter says:

    Thanks a lot for this solution. It made no sense to me, that part of the remote report was displayed and not images and part of the dropdown did not display.

  22. Raul says:

    This is unbelievable, I spent days trying to figure this out.

    The thing that did the trick for me at the end was to create the empty control file on the root as one of the comments suggested…

  23. Jared says:

    Worked a treat for me, thanks for this!

  24. Ubaid ur Rehman Baig says:

    Great work, thanks a lot. It saved a lot of time.

  25. Umapathy Ps says:

    Thanks a lot its working for me in the Live.

  26. Amber Fontes says:

    This worked for me – thanks!  

    One problem I still have is the dropdown menus are locked for export format, page size and any parameter lists.  May be a separate ajax issue.

  27. Dave says:

    Congrats, you've saved another developer! Many thanks!

  28. Abhishek says:

    Thanks alot , Mr. Vijay, It worked fine.

  29. Cel says:

    I love you man! Give me a kiss; been searching for hours!

    Hell it moved to system.webServer!!!

  30. Atarpan says:

    Great Help maan …. tahnks a toN 🙂

  31. Sangaramoorthy says:

    This is a great work.Thank for this

  32. Wilson says:

    Very cool solution… Tnx buddy….

  33. Pham says:

    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.

  34. khautinh says:

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

  35. Anderson Mattos says:

    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.

  36. Daniel Kram says:

    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

  37. So Happy says:

    You are friggin awesome.  This worked like a charm.

  38. Andy says:

    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>

  39. Anonymous says:

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

  40. Yazan says:

    Thanks alot, this works like charm.

  41. Sunil says:

    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.

  42. Florence says:

    I have windows 7 and the report viewer stops me from opening some things in the search bar. I do not like the report viewer. Is it a must have or can I disable it?