![](/img/trans.png)
[英]Compatibility between Apache Poi 4.1.2 and net.sf.jxls (jxls-core 1.0.6)
[英]Exporting Large Amount Of Data Using Jxls-core 1.0.2
使用Jxls-core 1.0.2導出大量數據大家好,我在使用Jxls core 1.0.2導出(到excel)包含4萬多個項目的大bean時遇到了問題,有時會出現Java內存不足錯誤。 有沒有辦法在chunk中實現(以chunk編寫)? 少於5000可以正常工作
Map<String, Object> beans = new HashMap<String, Object>();
beans.put("users", users);
XLSTransformer transformer = new XLSTransformer();
Workbook workbook;
try {
workbook = transformer.transformXLS(new FileInputStream(filePath),
beans);
System.out.println(workbook);
workbook.write(responseOutputStream);
我建議您升級到jxls-2,可以輕松使用SxssfTransformer來滿足您的所有要求。
參見此處: https : //bitbucket.org/leonate/jxls-demo (特別是org.jxls.demo.SxssfDemo類)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.