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.
<rsweb:ReportViewer AsyncRendering="false" ID="reportViewer" Width="100%" Height="100%" runat="server" SizeToReportContent="True" > </rsweb:ReportViewer>
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.
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
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
<add name="ReportViewerWebControl" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
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
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).
These suggestion are very usefull
Wonderful. Report Viewer was giving headache on production host. Made that addition and it worked. Thanks
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
Thank you SO Much, this was driving me crazy
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.
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...
Worked a treat for me, thanks for this!
More things to know.
Check it here.
Great work, thanks a lot. It saved a lot of time.
Thanks a lot its working for me in the Live.
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.
Congrats, you've saved another developer! Many thanks!
Thanks alot , Mr. Vijay, It worked fine.
I love you man! Give me a kiss; been searching for hours!
Hell it moved to system.webServer!!!