Streaming only Java API for Excel

I have a web application that supports loading large result sets (400K + rows) in Excel format. The limitation I have with Apache POI is that I have to generate the entire excel file before I can stream, this causes a lot of stress on the application servers.

Is there a way that I can transfer the excel file multiple lines at a time? This is just an operation with a single worksheet. I will not modify already created cells

I can do it in CSV, but formatting is required here.

+3


source to share


1 answer


You might want to take a look at the SXSSF Howto , which describes how you can write an XLSX stream using basically the same API as XSSF.

This works by creating a "window" on the sheet that moves with the cells that are currently written. I can confirm that it works even when creating very large streams.



Note that this section uses temporary storage for the unwritten stream and will only be written after the workbook is finished.

+1


source







All Articles