Quantcast
Channel: NPOI
Viewing all articles
Browse latest Browse all 1621

Commented Unassigned: Exporting large files into XLSX [13605]

$
0
0
Hi,

I have a requirement where I need to create and excel file with 15000 records and 300 columns.
When I try to save the file using the following code

using (var fileData = new System.IO.FileStream(fileName, System.IO.FileMode.Create))
{
workbook.Write(fileData);
}
it is failing with OutOfMemoryException.

My question is how can I save large files (>30MB).

Thanks
Vijay
Comments: ** Comment from web user: ebyrob **

In Apache POI there is a serialized version of at least the XSSF side of things.

org.apache.poi.xssf.streaming.SXSSFWorkbook

I don't see this implemented in NPOI currently, but I'm hoping sometime in the future this can be ported over to C#.

Note: I'm having the same problem you are, but with reading a large XLSX file:

FileStream fs = new FileStream("foo.xlsx", FileMode.Open);
NPOI.SS.UserModel.IWorkbook wb = new NPOI.XSSF.UserModel.XSSFWorkbook(fs);

OutOfMemoryException (on 50 meg file using 1.7 gigs in process) at XSSFWorkbook constructor.


Viewing all articles
Browse latest Browse all 1621

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>