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=9.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file
这个错误即将到来.我已经在http处理程序中提到了这一行,但仍然收到此错误
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler,Version=8.0.0.0,PublicKeyToken=0000000000000000" validate="false" />
我的html页面标记如下
<%@ Register Assembly="Microsoft.ReportViewer.WebForms,PublicKeyToken=b03f5f7f11d50a3a" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Button ID="btnsubmit" runat="server" OnClick="GenerateReportButton_Click" /> <rsweb:ReportViewer ID="ReportViewer1" runat="server"> </rsweb:ReportViewer> </asp:Content>
Web配置程序集部分如下:
<assemblies> <add assembly="System.Core,Version=3.5.0.0,PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions,PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Data.DataSetExtensions,PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Xml.Linq,PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.DataVisualization,PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Windows.Forms,Version=2.0.0.0,PublicKeyToken=B77A5C561934E089"/> <add assembly="Microsoft.ReportViewer.WebForms,PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="Microsoft.ReportViewer.Common,PublicKeyToken=B03F5F7F11D50A3A"/> </assemblies>
解决方法
我遇到了同样的问题.发生了什么事情是将报表加载例程放在Page_Load上,并没有将其包装到if(!IsPostBack)中. ReportViewer对页面进行了POST,这是触发Page_Load并重新加载报告,不知何故搞砸了.将所有内容放在if(!IsPostBack)之后,就像一个魅力一样.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。