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

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

问题描述

已部署并运行报告,并在报告管理器中进行了验证.

Reports are deployed and working, verified in Report Manager.

我的应用程序是MVC2应用程序,我的报表位于其自己的aspx页面上.该页面与报表查看器控件的版本8配合使用,但是我们移至新服务器,升级的sql服务器,并试图更新我们的网站以使其匹配.

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:

报表查看器配置错误

Report Viewer Configuration Error

尚未在以下位置注册Report Viewer Web控件HTTP处理程序 应用程序的web.config文件.将<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />添加到system.web/httpHandlers web.config文件的部分",或将<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" />添加到system.webServer/handlers Internet 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?

推荐答案

我发现了一种快速而肮脏的解决方法-在您的Web配置中添加以下内容:

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>

我在提琴手中看到,由于某种原因,当页面请求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天全站免登陆