locked
"ASP.Net session has expired" error when exporting results to Excel RRS feed

  • Question

  • User-1210839387 posted

    Using Report Services 2005

    I am running a report that returns just over 20,000+ rows of data (and 19 columns in each row) and it runs fine when I return the results to the report window.

    However after first returning the results to the report window the users then need to export the results to excel and when they do they are not able to do so, it appears that the amount of data is too much and the system is set up to record user errors and store them in an error table. The user that was having issues has the following logged in the table:

    <MESSAGE>

    ASP.NET session has expired

    </MESSAGE>

    <STACKTRACE>

    MESSAGE:
    ASP.NET session has expired

    STACK TRACE:
    at Microsoft.Reporting.WebForms.ReportDataOperation..ctor()     
    at Microsoft.Reporting.WebForms.HttpHandler.GetHandler()     
    at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)     
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()     
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    </STACKTRACE>

    Has anyone else experienced something like this?  Like I said i assume that its just too much, can you set the limit on the amount of data that you can export to excel or is it just the session time limit that can be set on the server?

    I'm wondering if I should go to SQL Server Mgmt studio, run the stored proc and then try to export to Excel to see if I have an issue.

    thanks

    MC

    Wednesday, April 18, 2012 10:08 AM

Answers

  • User2105670541 posted

    in such case you should try to increase the request length in web.config file, I hope this will help you to solve the problem.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 18, 2012 2:18 PM

All replies

  • User2105670541 posted

    Session time can be set in web.config file in below tag under <system.web> tag:

    <sessionState timeout="20"></sessionState>



    Wednesday, April 18, 2012 10:20 AM
  • User1459951572 posted

    You can try exporting to .csv file and then open it in excel as the limit is set to around 64K records.

    Please see the below discussion.

    http://social.technet.microsoft.com/Forums/en-US/operationsmanagerreporting/thread/37f2b53b-121f-49a5-87cb-5ac539a4cb23/

    As an immidiate fix you can increase the timeout limit.

    Thanks,

    Wednesday, April 18, 2012 10:25 AM
  • User-1210839387 posted

    Session time can be set in web.config file in below tag under <system.web> tag:

    <sessionState timeout="20"></sessionState>

    thanks, I just checked and the timeout is set to "60" so I don't think that is the issue.

    Is there a data limit when exporting to excel?

    UPDATE:  when I try to export to excel on my machine running the report by clicking on "Preview" all works well.  Also, there is a dev report server and when I run the reporting user REport Manager on the dev server and then export to excel all works fine so this looks like its either a .net config or IIS setting on the live server that is causing the issue.

    I tried exporting to PDF also on the live server and got the same error so it looks like it is simply a matter of too large of amount of data to export but trying to figure out which setting and where is causing this.

    Wednesday, April 18, 2012 10:29 AM
  • User2105670541 posted

    Hi,

    In certain situation if you are passing huge data in asp.net then you must set the data limit in web.config, it can be set like below:

    <httpRuntime executionTimeout="1000" maxRequestLength="2000000" /> 

    Im not pretty sure what is happening there, I can assume it because of the huge data. you can also give a try to set the above code in your web.config.



    Wednesday, April 18, 2012 1:16 PM
  • User-1210839387 posted

    Hi,

    In certain situation if you are passing huge data in asp.net then you must set the data limit in web.config, it can be set like below:

    <httpRuntime executionTimeout="1000" maxRequestLength="2000000" /> 

    Im not pretty sure what is happening there, I can assume it because of the huge data. you can also give a try to set the above code in your web.config.

    this is very good suggestion.  The file is 15MB but the maxRequestLength is set to about 12 MB so I am thinking that this might be an issue.  I dont have access to the server since i'm a mere programmer but will try to see if I can get that changed.

    Wednesday, April 18, 2012 1:49 PM
  • User2105670541 posted

    in such case you should try to increase the request length in web.config file, I hope this will help you to solve the problem.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 18, 2012 2:18 PM