流一个工作簿POI对servlet输出流 [英] Streaming a POI workbook to the servlet output stream
问题描述
我建一个非常大的POI工作簿时,我的Web服务器上。保持整个工作簿在内存中,将不能扩展多个并发请求。有没有一种办法可以逐步编写工作簿servlet输出流。这应该缩短响应时间,以及使进程的内存效率。
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.
推荐答案
如果您要生成Excel 2007中(XSLX),然后按此处所述,你可以适应BigGridDemo.java的方法:的http://web.archive.org/web/20110821054135/http://www.realdevelopers.com/blog/$c$c/excel
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
的解决方案是让POI生成一个容器XSLX因为只有一个模板与实际US preadsheet数据作为XML流成zip输出流。精简XML生成然后由你。
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.
这篇关于流一个工作簿POI对servlet输出流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!