【发布时间】:2011-03-28 23:31:48
【问题描述】:
在 IIS 7 下运行的 SQL Server Reporting Services R2 报告出现 javascript 错误。这些报告与 IIS 在同一台服务器上运行。报表查看器控件嵌入在 MVC 1.0 页面上的 iFrame 到经典的 asp.net 页面中(尽管当我单独运行报表页面时也会出现同样的问题)。
我没有在报告中添加额外的自定义 javascript。也就是说,页面上只有报表查看器控件自带的stock javascript。
在 Firefox 4 下,当我运行带有日期参数的报告时,该报告使用默认日期运行正常。如果我更改它们,我会收到以下错误:
frames.ReportViewerTouchSession0.location is null
document.getElementById("ReportViewer_ctl00").ParametersController is undefined
报告不会刷新,无论是通过自动回发还是我通过“查看报告”按钮手动触发。
IE8 我明白了:
'document.getElementById(...).ParametersController' is null or not an object
IE8 的调试器在 ViewState 中的某个随机位置中断。
IE9的错误不同(点击日期选择器时):
Unable to get value of the property 'ToggleVisibility': object is null or undefined
Unable to get value of the property 'HideActiveDropDown': object is null or undefined
同样,调试器无法在任何源代码中为我提供有用的行号。
没有任何可能表明脚本未加载的 404 网络错误。
在True 和False 之间更改AsyncRendering 属性没有任何影响。
我发现您需要在 web.config as detailed here 中移动 web 处理程序。这解决了我遇到的其他一些问题,但这个问题仍然存在。
我用这个把头发扯掉了!
为了完整起见,这里是页面的 asp.net 代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="Tenders.Web.Report" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server"></head>
<body>
<form id="form1" action="/Report.aspx" runat="server">
<asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true" ScriptMode="Release">
</asp:ScriptManager>
<asp:UpdatePanel ID="ReportViewerUP" runat="server">
<ContentTemplate>
<rsweb:ReportViewer ID="ReportViewer" runat="server" Width="100%" ProcessingMode="Local"
InteractivityPostBackMode="AlwaysAsynchronous" AsyncRendering="true">
</rsweb:ReportViewer>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
【问题讨论】:
标签: asp.net asp.net-mvc reporting-services