asp.net-mvcasp.net-mvc-2iis-7report-viewer2010

Asp.net MVC ReportViewer ,IIS 7 issue


I use asp.net mvc 2, added webform with reportviewer controls.

The web.config file looks

     <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting`enter code here`.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b0`enter code here`3f5f7f11d50a3a" />

    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

  <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add name="Reserved.ReportViewerWebControl.axd" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />

IIS is configured as a link

http://otkfounder.blogspot.com/2007/11/solving-reportviewer-rendering-issue-on.html

But I still have the error

Report Viewer Configuration Error

The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add <add verb="" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file, or add <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.webServer/handlers section for Internet Information Services 7 or later.


Solution

  • Here's what we have - it should support both IIS 6 and IIS7+ I think you've got a reference to v9 of Reserved.ReportViewerWebControl.axd (Reporting Services 2005)

    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <assemblies>
                                    <etc />
                <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </assemblies>
                            <!-- Edit Unsure as to whether this is needed, or should be Microsoft.ReportViewer.Webforms. Was upgraded from RDLC v9 -->
            <buildProviders>
                <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
            </buildProviders>
        </compilation>
    
    
        <!-- NB : The below is for earlier IIS -->
        <httpHandlers>
            <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>
    
    </system.web>
    <system.webServer>
        <!-- NB : The below is for IIS 6+ W2008 Server / Vista -->
        <handlers>
            <add name="Reserved-ReportViewerWebControl-axd" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" resourceType="Unspecified" preCondition="integratedMode"/>
        </handlers>
    </system.webServer>
    

    Edit : Note that as of v10 the RdlBuildProvider is now in Microsoft.ReportViewer.WebForms not in Microsoft.ReportViewer.Common