日期:2014-05-17  浏览次数:20565 次

ReportViewer报表一直处于“正在加载”,而且不停请求Reserved.ReportViewerWebControl.axd什么原因呢,焦急啊!!
本帖最后由 fuyun2000 于 2013-04-15 17:28:39 编辑
老的项目一直在2008上开发,但是那是9.0版本的ReportViewer,不轻易间会出现内存溢出的情况,百度了下,好像微软确实有这个问题存在,所以今天决定升级到11.0版本(VS2012下装的就是这个版本)然后替换了有关报表的所有DLL,并且修改了配置文件和页面上的程序集引用版本
问题出来了:

第一是出现在 Web 窗体上报表查看器 Web 控件需要 System.Web.UI.ScriptManager的异常
然后我就加了这个  <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
现在没报错了,但是打开页面后出现下面问题:

首先报表一直处于“正在加载”,然后firebug下看,发现一直在请求下面三个文件,一直循环
请求
Reserved.ReportViewerWebControl.axd?OpType=Resource&Version=11.0.2802.16&Name=ViewerScript
ScriptResource.axd?d=f-An-ct4xaEGxdOwf1dJy-Bw1qsb8gQuD7Vjg2&t=fffffffff9d85fa6
报表页.aspx

报表 Web

------解决方案--------------------
Calling methods like SetParameters isn’t cheap.  Each call triggers a round trip to the report server.  So it’s a call you want to minimize anyway.  By only calling SetParameters during the initial GET request or only when parameter values have actually changed, you can improve the performance of your application and break the loop.  A simple check of IsPostBack before calling SetParameters is usually sufficient.

不能调用SetParameters, 或者只调用一次SetParameters