question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClosedXML throwing out of memory exception when exporting 73000 records

See original GitHub issue

Exception is coming at this particular line of code -

wb.Worksheets.Add(DynamicSource);

dynamicsource is the datatable that has all the data to be exported

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jk-2017commented, Feb 19, 2017

As a work around to out of memory problem, I am directly saving excel to physical location without doing anything with memory stream. I am getting a different exception now when saving data to excel. There is no NULL data in the dataset. I tried to loop through each and every row and column in dataset to replace hexadecimal value but that taking forever to run.

Exception: ’ ', hexadecimal value 0x0B, is an invalid character

Code snippet – using (XLWorkbook wb = new XLWorkbook()) { wb.Worksheets.Add(DynamicSource); wb.SaveAs(@“C:\Work\Grid1.xlsx”); }

0reactions
iswaryaRengarajancommented, Jul 5, 2017

hi jk, i too have same issue once u get the solution help me to do this

Read more comments on GitHub >

github_iconTop Results From Across the Web

ClosedXML OutofMemoryException on more records
ClosedXML cannot export a big quantities of row and data and this is disadvantage of this library. I recommend you to use OpenXML....
Read more >
The easy way to OpenXML - ClosedXML
I am using closedxml to export datatable to excel in asp.net. it works fine if i export less than 50k rows but throwing...
Read more >
How to avoid out of memory exception while exporting ...
The out of memory exception occurs while exporting the GridControl with more number of rows and columns. This exception occurs because new cell...
Read more >
How to fix system.out of memory exception in ASP.NET
The easiest way to find out is to use the debugger to look at what ... If you are trying to export more...
Read more >
system outofmemoryexception was thrown while export to ...
But when exporting large data, then the data doesn't get exported instead an exception occurs like:- "system.outofmemoryexception ".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found