reporting-services - 尽管设置正确,报告查看器 Web 控制版本 10 仍会出错

标签 reporting-services iis-7.5 reportviewer report-viewer2010

报告已部署和工作,并在报告管理器中进行验证。

我的应用程序是一个 MVC2 应用程序,我的报告在它自己的 aspx 页面上。此页面使用报表查看器控件的第 8 版,但我们迁移到新服务器,升级了 sql server,并尝试更新我们的网站以匹配。

服务器是带有 IIS 7.5 的 Windows Server 2008。

我正在 chrome 和 IE 9 中进行测试。

尽管我尽了最大的努力,但我仍然收到此错误:

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.



但是,我已经这样做了。事实上,我什至从 MSDN 读到了这篇文章:

To use IIS 7.0 in Integrated mode, you must remove the HTTP handler in system.web/httpHandlers. Otherwise, IIS will not run the application, but will display an error message instead.



为了安全起见,我在将处理程序直接添加到 IIS 时尝试了两者的组合,仅在我的配置中添加了 Web 服务器 http 处理程序,在我的配置中仅添加了 http 处理程序,以及两者。

让我们从我的 web.config 开始
<configuration
  <system.web>
    <httpRuntime maxQueryStringLength="4096" />
    <compilation targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <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>
        <buildProviders>
            <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </buildProviders>
    </compilation>
  </system.web>
  <system.webServer>
    <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"  />
    </handlers>
  </system.webServer>
</configuration>

我有程序集、构建提供程序和处理程序。还有什么问题?

最佳答案

我找到了一个快速而肮脏的解决方法 - 在您的网络配置中添加以下内容:

<location path="Reserved.ReportViewerWebControl.axd">
  <system.web>
    <authorization>
      <allow users="*" />
    </authorization>
  </system.web>
</location>
我在 fiddler 中看到,由于某种原因,当页面请求 Reserved.ReportViewerWebControl.axd 而不是获取 HTTP 200 响应服务器会发送 302 - 移至 login.aspx?returnurl="Reserved.ReportViewerWebControl.axd。因此允许所有用户进入处理程序路径解决了这个问题。

关于reporting-services - 尽管设置正确,报告查看器 Web 控制版本 10 仍会出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8216186/

相关文章:

connection-string - 在 SSRS2008 中使用动态连接字符串

reporting-services - 导出到 SSRS 中的 excel

c# - 访问 IIS 全局应用程序设置

iis - 如何允许匿名访问 IIS 7.5 上的网站?

c# - 报告查看器版本 11.0.0.0。参数下拉不会第二次打开

reporting-services - 如何在SSRS报告中将每一行显示为不同的页面?

c# - 如何获取报告服务实例上可用的报告列表

coldfusion - 在 Win2k8 R2 x64 上处理 ColdFusion 10 中的 404 错误时遇到问题?

c# - RDLC 报告超链接在浏览器中不起作用

reporting-services - 将小计添加到SSRS报告Tablix