Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 777443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:36:26+00:00 2026-05-14T19:36:26+00:00

Summary: ASP.Net website with a couple hundred users. Data is exported to Excel files

  • 0

Summary: ASP.Net website with a couple hundred users. Data is exported to Excel files which can be relatively large (~5 MB).

In the pilot phase (just a few users), we are already seeing occasional errors on the server in the exporting method.

Here’s the stack trace:

System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. --->
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.    at
System.IO.MemoryStream.set_Capacity(Int32 value)    at
System.IO.MemoryStream.EnsureCapacity(Int32 value)    at
System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)   at
MS.Internal.IO.Packaging.TrackingMemoryStream.Write(Byte[]buffer, Int32 offset, Int32 count)   at
MS.Internal.IO.Packaging.SparseMemoryStream.WriteAndCollapseBlocks(Byte[] buffer, Int32 offset, Int32 count)  at
MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[]buffer, Int32 offset, Int32 count)   at
MS.Internal.IO.Packaging.CompressEmulationStream.Write(Byte[]buffer, Int32 offset, Int32 count)   at
MS.Internal.IO.Packaging.CompressStream.Write(Byte[]buffer, Int32 offset, Int32 count)   at
MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[]buffer, Int32 offset, Int32 count)   at
MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[]buffer, Int32 offset, Int32 count)   at
System.IO.StreamWriter.Flush(BooleanflushStream, Boolean flushEncoder)   at 
System.IO.StreamWriter.Write(String value)    at
System.Xml.XmlTextEncoder.Write(String text)    at
System.Xml.XmlTextWriter.WriteString(String text)    at
System.Xml.XmlText.WriteTo(XmlWriter w)    at
System.Xml.XmlAttribute.WriteContentTo(XmlWriter w)    at
System.Xml.XmlAttribute.WriteTo(XmlWriter w)    at
System.Xml.XmlElement.WriteTo(XmlWriter w)    at
System.Xml.XmlElement.WriteContentTo(XmlWriter w)    at
System.Xml.XmlElement.WriteTo(XmlWriter w)    at
System.Xml.XmlElement.WriteContentTo(XmlWriter w)    at
System.Xml.XmlElement.WriteTo(XmlWriter w)    at
System.Xml.XmlElement.WriteContentTo(XmlWriter w)    at
System.Xml.XmlElement.WriteTo(XmlWriter w)    at
System.Xml.XmlDocument.WriteContentTo(XmlWriter xw)    at
System.Xml.XmlDocument.WriteTo(XmlWriter w)    at
System.Xml.XmlDocument.Save(Stream outStream)    at
OfficeOpenXml.ExcelWorksheet.Save() in
C:\temp\XXXXXXXXXX\ExcelPackage\ExcelWorksheet.cs:line 605    at
OfficeOpenXml.ExcelWorkbook.Save() in
C:\temp\XXXXXXXXXX\ExcelPackage\ExcelWorkbook.cs:line 439    at
OfficeOpenXml.ExcelPackage.Save() in
C:\temp\XXXXXXXXXX\ExcelPackage\ExcelPackage.cs:line 348    at
Framework.Exporting.Business.ExcelExport.BuildReport(HttpContext context)    at
WebUserControl.BtnXLS_Click(Object sender, EventArgs e) in
C:\TEMP\XXXXXXXXXX\XXXXXXXXXX\XXXXXXX\UserControls\ExportToExcel.ascx.cs:line 108    at
System.Web.UI.WebControls.Button.OnClick(EventArgs e)    at
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)    at
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)   at
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)    at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
---End of inner exception stack trace ---
at
System.Web.UI.Page.HandleError(Exception e)    at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    at
System.Web.UI.Page.ProcessRequest()    at
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)    at
System.Web.UI.Page.ProcessRequest(HttpContext context)    at
ASP.XXXXXXXXXXX_aspx.ProcessRequest(HttpContext context) in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\TemporaryASP.NET
Files\XXXX\cdf32a52\d1a5eabd\App_Web_enxdwlks.1.cs:line 0    at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    at
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Even aside from this particular problem, in general exporting to Excel requires the instantiation of huge Excel objects on the server for each request, which I’ve always assumed to mean disqualifies Excel for “serious” work on a highly-loaded server. Is there any general way to export to Excel in a “light-weight” manner? Would simply streaming the data into a CSV file work for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:36:26+00:00Added an answer on May 14, 2026 at 7:36 pm

    If formatting is not an issue, I would say yes to CSV.

    Another thing I noticed, you are using ExcelPackage. I ran into some issue using it with large files. I think It was the way it handled xml and exporting large files was really slow. I would recommend using some other library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an asp.net MVC application where users can attach a picture to their
I have an ASP.Net website which uses a MySQL database for the back end.
Summary: I have an ASP.NET MVC website in IIS named 'Website' using an AppPool
Summary We have an ASP.NET application that allows users to query a SQL Server
If you go to this website, http://www.asp.net/mvc/tutorials/getting-started-with-aspnet-mvc3/cs/intro-to-aspnet-mvc-3 , you can see a tutorial where
SUMMARY: When browsing an ASP.NET website using Windows Explorer, popup windows do not borrow
I'm currently working on an ASP.NET Website where I want to retrieve data from
Hey. We're building a large ASP.NET website, and have hired an external firm to
Can anyone please give me a nice, expert but concise summary the ASP.NET compilation
I'm trying to figure out how the heck the validation summary control of ASP.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.