none
ASP.Net ReportViewer causes Exception in JScript RRS feed

  • Question

  • 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?


    • Edited by David Faber Wednesday, May 16, 2012 2:46 PM
    Wednesday, May 16, 2012 2:31 PM

Answers

  • 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


    Tuesday, May 22, 2012 1:08 PM

All replies

  • 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:

    Hope this helps.

    Regards,
    Mike Yin

    Tuesday, May 22, 2012 7:01 AM
    Moderator
  • 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


    Tuesday, May 22, 2012 1:08 PM
  • 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

    Thursday, May 24, 2012 5:30 PM
    Moderator