-
Notifications
You must be signed in to change notification settings - Fork 567
Description
Environment:
OpenXmlWriter(Package:3.3.0)
.NET Version: .Net Core 8
Operating System: Windows 10
Issue Summary:
We are generating an Excel file with approximately:
180 columns
500,000 rows
Cell formatting applied throughout
While writing data using OpenXmlWriter, the process fails after approximately 350,000 rows with the following exception:
Exception in Stream was too long.
Exception of type 'System.OutOfMemoryException' was thrown.
Steps to Reproduce:
Create a workbook and worksheet.
Populate 180 columns with formatted data.
Loop through and write 500,000 rows.
Save the workbook.
Expected Behavior: The Excel file should be generated successfully without memory issues.
Actual Behavior: The process throws an OutOfMemoryException after writing around 350,000 rows.
Additional Context:
We are using cell formatting (e.g., Date Format, Number Format,Aligment,Background Color) for each cell.
The issue seems to be related to memory usage or stream limits during serialization.
Request:
Is there a recommended approach to handle large datasets with formatting?
Are there any memory optimization techniques or streaming options available in OpenXmlWriter(Package:3.3.0)?