开发者

Java write Excel files with POI event model

Is it possible to create and write to a (new) excel file using the event driven API from POI? I've found examples on how to r开发者_开发问答ead with that API, but not how to write.

thanks, Jeff


Here is one possibility, not very well written, though:

http://www.docjar.org/html/api/org/apache/poi/xssf/usermodel/examples/BigGridDemo.java.html

I'm using a modified version of that, which does not require temporary files and is overall more efficient


Yes. Absolutely. Look at POI-XSSF and POI-HSSF

http://poi.apache.org/spreadsheet/how-to.html#user_api


You could use the SXSSF from Apache POI

https://poi.apache.org/spreadsheet/how-to.html#sxssf


I'vr worked with SXSSF from Apache POI. It is really good for writing huge files of data since it keeps only a small part of data in memory and flushes the remaining to disk, as opposed to HSSF or XSSF which keep all data in memory till finally writing at once. But unfortunately, SXSSF is that it is meant only for writing, not for reading.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜