开发者

Reporting Services 2008 R2 javascript errors when using date parameters

开发者 https://www.devze.com 2023-02-20 15:01 出处:网络
I\'m getting javascript errors on my SQL Server Reporting Services R2 reports running under IIS 7. The reports are running on the same server as IIS. The report viewer control is embedded in an iFrame

I'm getting javascript errors on my SQL Server Reporting Services R2 reports running under IIS 7. The reports are running on the same server as IIS. The report viewer control is embedded in an iFrame on an MVC 1.0 page to a classic asp.net page (although the same problems occur when I run the report page on its own).

I have not added extra custom javascript on the reports. That is to say, there is only the stock javascript that comes with the report viewer control on the page.


Under Firefox 4, when I run a report with a date parameter, the report runs OK with the default dates. If I change them, I get these errors:

frames.ReportViewerTouchSession0.location is null
document.getElementById("ReportViewer_ctl00").ParametersController is undefined

The report does not refresh, either by the automatic post back or if I manually trigger one via the "View Report" button.

IE8 I get this:

'document.getElementById(...).ParametersController' is null or not an object

IE8's debugger breaks on some random location in the ViewState.

IE9's error is different (when you click on the date picker):

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 

Again, the debugger can't give me a useful line number in any source code.

There aren't any 404 network errors that might indicate scripts aren't being loaded开发者_开发技巧.

Changing the AsyncRendering property between True and False doesn't have any affect.

I've found that you need to move the web hander in web.config as detailed here. Which fixed some other problems I was having, but this problem remains.


I'm tearing my hair out with this one!


For completeness, here's the asp.net code for the page:

<%@ 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>


It appears I was using the wrong version of the report viewer control. Changing project and web.config reference from v9 to v10 of the Microsoft.ReportViewer.WebForms assembly has fixed the issue.

See this connect bug for more info (including demo projects to reproduce the bug and the fix): https://connect.microsoft.com/VisualStudio/feedback/details/694408/reporting-services-2008-r2-reportviewer-javascript-errors-when-using-date-parameters

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号