ASP.Net ReportViewer causes Exception in JScript
Hello everybody, I'm trying to implement a ReportViewer control in my ASP.Net page. The Control itself is placed there correctly but if I set AsyncRendering=true or I click the "Next Page"-Button within the Control I get the following error in my Visual Studio: Runtime error in Microsoft JScript: Sys.WebForms.PageRequestManagerServerErrorException: The object reference was not set to an instance. The control itself is realized like that in my .aspx Page: <asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Path="js/ClientCode.js" /> </Scripts> </asp:ScriptManager> <rsweb:ReportViewer ID="ShowReport" runat="server" ProcessingMode="Remote" SizeToReportContent="true" AsyncRendering="true" Height="500px"> <ServerReport DisplayName="Report Name" ReportServerUrl="http://[SqlServer]/ReportServer" ReportPath="/[ReportFolder]/[ReportName]" /> </rsweb:ReportViewer> </asp:Content> I've commented out the whole section in code behind, so basically it should just display the report (I tried setting the report dynamically, which basically causes the same exception) however it just comes up with the above Exception. What am I doing wrong?
May 16th, 2012 10:34am

Hi Mike, setting EnablePartialRendering did just cause the error to appear after the Page_Load was done. Though I accidentally started my VS2010 with admin privileges a couple of minutes ago and the error was gone. The Reports work fine, even with AsyncRendering set to true. Changing them dynamically in code behind also works. After restarting my Visual Studio (neither the PC nor the ISS process) with normal user rights the error did not re-appear however. So I guess this has something to do with my IIS worker process and an access rights issue. Regards, David
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2012 9:11am

Hi David, Thanks for your feedback. I agree with you that the issue may be related to the IIS and certain permissions issue. Hope your feedback on this issue can provide an idea for the people who face the same issue. Thanks, Mike Yin
May 26th, 2012 1:41pm

Hi David, From your thread history, it seems that you are using Visual Studio 2010. Based on my research, the issue might be caused by the partial-page rendering. In Visual Studio 2010, all subsequent report renderings are accomplished with AJAX partial-page updates through asynchronous postbacks, and changing the AsyncRendering property has no effect by default. At this time, I suggest that you set the partial-page rendering to false as follows: <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="false" /> References: ReportViewer.AsyncRendering PropertyPartial-Page Rendering Overview Hope this helps. Regards, Mike Yin
Free Windows Admin Tool Kit Click here and download it now
May 27th, 2012 3:11am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics