Apache POI 和 JExcel Api 的评估
我需要在 Grails 中创建 Excel woorkbook,Grails 支持 Apache POI 和 JExcel Api,但我希望您告诉我两者的优点和缺点。
据我所知,Apache POI 比 JExcel Api 更快,但 JExcel API 有最友好的代码。
请告诉我您的经历。
谢谢
I need create Excel woorkbooks in Grails, Grails support both Apache POI and JExcel Api, but I would like you to tell me about the advantages and disadvantages of both.
According to I know, Apache POI is more faster than JExcel Api, but the JExcel API have a mos friendly code.
Please if do you tell me about your experience.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有几个区别:
我用这两种方法完成了项目,但并没有真正发现其中一种如此完美,以至于我可以放弃另一种,这确实非常依赖于任务。
A couple of differences:
I've done projects with both and did not really find one so superlative I could abandon the other, it's really very task dependent.
差异:
JExcel 具有更好的 API 文档,您可以轻松地在网络上找到教程。另一方面,与 JExcel 相比,apache POI 没有很好的文档,但它确实有一个非常好的恶意列表/论坛,那里的人们很友好且乐于助人。
创建大型 Excel 2003 工作表时,您将遇到内存不足问题,因为两个 API 在生成文件之前都会将所有数据转储到内存中。为了解决这个问题,apache POI 推出了名为 XSSF 的新实现,它允许您创建大型 Excel 2007 工作表而不会出现 OutOfMemory 问题。这是 POI 的一大优势,也是我选择 POI 而不是 JExcel 的原因。
PS:如果您对 XSSF 生成大 .xlsx 文件感兴趣,请在 Google 上搜索“BigGridDemo.java”。
Differences:
JExcel has better API documentation whereby you can easily find tutorials on the web. On the other hand, apache POI does not have a good documentation compared to JExcel but it does have a very good maling list/forum whereby people there are friendly and helpful.
You will have OutOfMemory problem when creating large Excel 2003 sheets as both APIs dump all data into memory before generating the file. To solve this problem, apache POI comes out with new implementation called XSSF which allows you to create large Excel 2007 sheets without having the OutOfMemory problem. This is a great POI's advantage and that's why I choose POI over JExcel.
PS: If you are interested on XSSF to generate big .xlsx file, search 'BigGridDemo.java' on Google.