Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Streaming a POI workbook to the servlet output stream

Tags:

I build a very large POI workbook, on my web server. Holding the entire workbook in memory , will not scale for multiple concurrent requests. Is there a way i can progressively write the workbook to the servlet output stream. That should reduce the response time , as well as make the process memory efficient.

like image 718
The Machine Avatar asked Apr 20 '10 08:04

The Machine


1 Answers

If you are about to generate Excel 2007 (xslx) then you could adapt the approach of BigGridDemo.java as described here: http://web.archive.org/web/20110821054135/http://www.realdevelopers.com/blog/code/excel

The solution is to let POI generate a container xslx as a template only and stream the actual spreadsheet data as XML into a zip output stream. Streamlining the XML generation is then up to you.

like image 145
hlg Avatar answered Sep 18 '22 23:09

hlg