This project is read-only.
1
Vote

System.OutOfMemoryException: Exception While Excel Export

description

1. ISSUE GENERATE WHILE CREATING ROW WITH BELOW SET OF RECORDS.
 Exporting Excel Row: 130686
 Exporting Excel Columns:  30 Columns

__fieldValue:__ 02048906_00000
__Code:__  crow.CreateCell(cellindex).SetCellValue(Convert.ToString(fieldValue));

__Exception:__
 at System.Text.StringBuilder..ctor(String value, Int32 startIndex, Int32 length, Int32 capacity)
   at NPOI.SS.Util.CellReference.FormatAsString()
   at NPOI.XSSF.UserModel.XSSFCell.SetCellNum(Int32 num)
   at NPOI.XSSF.UserModel.XSSFRow.CreateCell(Int32 columnIndex, CellType type)
   at NPOI.XSSF.UserModel.XSSFRow.CreateCell(Int32 columnIndex)

2. ISSUE GENERATE WHILE SAVING FILE (XSSFWorkbook.Write(new FileStream(outputFilePath, FileMode.Create, FileAccess.Write));) WITH BELOW SET OF RECORDS.
Exporting Excel Row: 130686
Exporting Excel Columns:  15 Columns

Exception:
   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 NPOI.OpenXml4Net.OPC.Internal.MemoryPackagePartOutputStream.Write(Byte[] b, Int32 off, Int32 len)
   at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
   at System.IO.StreamWriter.Write(String value)
   at NPOI.OpenXmlFormats.Spreadsheet.CT_Rst.Write(StreamWriter sw, String nodeName)
   at NPOI.OpenXmlFormats.Spreadsheet.SstDocument.Save(Stream stream)
   at NPOI.XSSF.Model.SharedStringsTable.WriteTo(Stream out1)
   at NPOI.XSSF.Model.SharedStringsTable.Commit()
   at NPOI.POIXMLDocumentPart.OnSave(List`1 alreadySaved)
   at NPOI.POIXMLDocumentPart.OnSave(List`1 alreadySaved)
   at NPOI.POIXMLDocument.Write(Stream stream)
Please Help...

comments