尽管设置正确,报告查看器 Web 控制版本 10 仍会出错 [英] Report Viewer Web Control Version 10 Gives Error Despite Set Up Correctly

查看:16
本文介绍了尽管设置正确,报告查看器 Web 控制版本 10 仍会出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Reports are deployed and working, verified in Report Manager.

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

My application is an MVC2 app with my report on its own aspx page. This page worked with version 8 of the report viewer control, but we moved to new servers, upgraded sql server, and are trying to update our website to match.

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

The servers are Windows Server 2008 with IIS 7.5.

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

I am testing in both chrome and IE 9.

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

Despite my best efforts, I still get this error:

报告查看器配置错误

报告查看器 Web 控件 HTTP 处理程序尚未在应用程序的 web.config 文件.添加 到 system.web/httpHandlersweb.config 文件的部分,或添加 到 system.webServer/handlersInternet Information Services 7 或更高版本的部分.

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:

But, I've already done this. in fact, I even read this from MSDN:

要在集成模式下使用 IIS 7.0,您必须删除 system.web/httpHandlers 中的 HTTP 处理程序.否则,IIS 将不会运行该应用程序,而是会显示一条错误消息.

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 处理程序,以及两者.

Just to be safe, I tried a combo of neither while adding the handler into IIS directly, just the web server http handler in my config, just the http handler in my config, and both.

让我们从我的 web.config 开始

Let's start with my 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>

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

I have the assemblies, the build provider, and the handler. What else could be wrong?

推荐答案

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

I found a quick and dirty workaround - to your web config add this:

<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".因此,允许所有用户访问处理程序路径即可解决问题.

I saw in fiddler that for some reason when page requested Reserved.ReportViewerWebControl.axd instead of getting HTTP 200 response server would send 302 - moved to login.aspx?returnurl="Reserved.ReportViewerWebControl.axd. So allowing all users to the handler path solves the problem.

这篇关于尽管设置正确,报告查看器 Web 控制版本 10 仍会出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆