Error while running ReportViewer

1

I put what he asks for in web.config.

Web.Config:

 <system.web>
    <globalization culture="pt-BR" uiCulture="pt-BR" />
    <compilation debug="true" targetFramework="4.5">
      <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      </buildProviders>
      <assemblies>
        <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
      </assemblies>
    </compilation>
    <httpRuntime targetFramework="4.5" />
    <authentication mode="Windows" />
    <customErrors mode="RemoteOnly">
      <error statusCode="401" redirect="/CustomErrors/401.htm" />
      <error statusCode="404" redirect="/CustomErrors/404.htm" />
    </customErrors>
    <httpHandlers>
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
    </httpHandlers>
  </system.web>
system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <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" />
      <remove name="ReportViewerWebControlHandler" />
    </handlers>
  </system.webServer>

It gives the following message:

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.

How do I fix this?

    
asked by anonymous 16.09.2015 / 15:30

1 answer

2

Well, the error is quite clear and tells you exactly what to do. Basically, you put the following in your web.config :

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

EDIT

The error is here:

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <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" />
      <!-- Retire a declaração abaixo -->
      <!-- remove name="ReportViewerWebControlHandler" /-->
    </handlers>
  </system.webServer>
    
16.09.2015 / 16:11