我在IIS 7下运行的SQL Server Reporting Services R2报告中出现javascript错误。报告与IIS在同一台服务器上运行。报表查看器控件嵌入在MVC 1.0页面上的iFrame中,并嵌入到经典的asp.net页面中(尽管当我自己运行报表页面时会出现同样的问题)。
我没有在报告中添加额外的自定义JavaScript。也就是说,页面上只有报表查看器控件附带的库存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网络错误可能表示未加载脚本。
更改AsyncRendering
和True
之间的False
属性没有任何影响。
我发现你需要在web.config as detailed here中移动网络管理员。这解决了我遇到的其他一些问题,但这个问题仍然存在。
我正用这个撕掉我的头发!
为了完整性,这里是页面的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>
答案 0 :(得分:0)
看来我使用的是错误版本的报表查看器控件。将项目和web.config引用从Microsoft.ReportViewer.WebForms
程序集的v9更改为v10已解决此问题。
有关详细信息,请参阅此连接错误(包括重现错误和修复的演示项目): https://connect.microsoft.com/VisualStudio/feedback/details/694408/reporting-services-2008-r2-reportviewer-javascript-errors-when-using-date-parameters