Archive for September 8th, 2010

MS Report Viewer Toolbar

I was working on a Web Application that required the use of Microsoft’s Reporting and Report Viewer. I have been use to using these together on a Windows Application and never had any issues with the Reports or the Report Viewer. But, come to find out, the Report Viewer Toolbar does not render properly on IIS 7.0. What’s even more silly is that when you are developing locally it renders just fine (I was using Visual Studio 2008). Nothing worked when I deployed/published to the web server:

< rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="False" Width="750px">
< /rsweb:ReportViewer>

Yep, images were missing from the toolbar as well as nothing really working at all. The toolbar uses images and JavaScript that is generated dynamically, using a call to “Reserved.ReportViewerWebControl.axd”. This is usually already completed for you when you add the control, and adds necessary references to your config files. You will usually find this:

< 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 >

One thing that has been left off the auto generate is something Microsoft messed up in the switch to IIS 7.0 from IIS 6.0 and you have to remember for this Report Viewer to also add manually:

< 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

, , , , ,

No Comments