ASP.NET Session Expired, Report Viewer Control

Discussion in 'ASP .Net Web Controls' started by Praveen, May 27, 2010.

  1. Praveen

    Praveen Guest

    I have spent some time researching this error and have tried all possible
    ways present out there but could not get it to work, so though of asking it
    to the smarter people. Here it goes...

    I have a web application that programmatically creates and
    instantiates a report viewer control to show a report stored in SharePoint
    (the goal is to eventually move this code to a SharePoint Web Part). Report
    server is installed in SharePoint integrated mode. The report work great
    when opened from SharePoint. But when I run in an ASP.NET control (using the
    code shown below) the report seem to have some problem rendering data. it
    shows data sometime and sometime shows blank row. In the event log I see an
    ASP.NET exception saying the ASP.NET session expired. The attached email has
    the exception.

    here is the code that i am trying:
    ReportView = new ReportViewer();
    ReportView.ID = "ReportViewer";
    ReportView.EnableViewState = true;
    ReportView.ProcessingMode =
    ReportView.AsyncRendering = false;
    ReportView.SizeToReportContent = true;

    ReportViewerCredentials rvwCreds = new
    ConfigurationSettings.AppSettings["pwd"], "US");
    ReportView.ServerReport.ReportServerCredentials = rvwCreds;

    // ReportView.ServerReport.Refresh();
    ServerReport serverReport = ReportView.ServerReport;

    // Set the report server URL and report path
    serverReport.ReportServerUrl = new
    serverReport.ReportPath =

    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 5/25/2010 1:14:34 PM
    Event time (UTC): 5/25/2010 6:14:34 PM
    Event ID: 4414d36b7a3745bd931259ee0be6d90e
    Event sequence: 4
    Event occurrence: 1
    Event detail code: 0

    Application information:
    Application domain: /LM/W3SVC/2/ROOT-1-129192848729442704
    Trust level: Full
    Application Virtual Path: /
    Application Path: C:\inetpub\wwwroot\testSite\
    Machine name: SPTSTLC02

    Process information:
    Process ID: 4588
    Process name: w3wp.exe
    Account name: MYDOMAINACCOUNT

    Request path: /Reserved.ReportViewerWebControl.axd
    User host address: X.X.X.X.X
    Is authenticated: True
    Authentication Type: Negotiate
    Thread account name: MYDOMAINACCOUNT

    Thread information:
    Thread ID: 3
    Thread account name: MYDOMAINACCOUNT
    Is impersonating: True
    Stack trace: at
    at Microsoft.Reporting.WebForms.HttpHandler.GetHandler(String
    at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&

    Exception information:
    Exception type: AspNetSessionExpiredException
    Exception message: ASP.NET session has expired

    SQL Server 2008
    MSRS 2008 in SharePoint Integrated Mode
    Report Viewer 2008 Redistributable with SP1
    ASP.NET 2.0
    Praveen, May 27, 2010
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.