选择一个excel java api

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1128318/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-29 15:17:04  来源:igfitidea点击:

Choosing an excel java api

javaexcelapache-poijexcelapiopenxls

提问by Victor

All I need to do is open an MS excel sheet - not sure which kind yet (2003, 2007, etc.) - and parse the information in each row into an object. I'm performing only readonly operations.

我需要做的就是打开一个 MS excel 表 - 不确定哪种类型(2003、2007 等) - 并将每一行中的信息解析为一个对象。我只执行只读操作。

out of Apache POI, JExcelAPI, or OpenXLSwhich is best for this task?

Apache POIJExcelAPIOpenXLS哪个最适合此任务?

I'd rather not find out about anymore api's but if you're certain that none of these are the best then I'll take your input.

我宁愿不再了解 api,但如果您确定这些都不是最好的,那么我会接受您的意见。

回答by Steve B.

I have used POI only but found it to be simple to use and work as advertised.

我只使用过 POI,但发现它使用起来很简单,而且如宣传的那样工作。

回答by Brian Beckett

I do NOT recommend OpenXLS. I used it for a little while but became very frustrated by the limits of the free version. If you want to write formulae, for example, you can't. Unless you buy the commercial version that the company behind OpenXLS sells, anyway.

我不推荐 OpenXLS。我使用了一段时间,但对免费版本的限制感到非常沮丧。例如,如果你想写公式,你就不能。除非您购买 OpenXLS 背后的公司销售的商业版本,否则。

I've been using JExcelAPI for the last few months and am quite impressed with it. It's very easy to use it to read and write Excel spreadsheets. The documentation is fairly good but it could be better. If you haven't already made your choice, I would recommend JExcelAPI to you.

过去几个月我一直在使用 JExcelAPI,对它印象非常深刻。使用它来读取和编写 Excel 电子表格非常容易。文档相当不错,但可能会更好。如果您还没有做出选择,我会向您推荐 JExcelAPI。

I'm afraid that I haven't tried POI so I can't comment on it.

POI 怕是没试过所以无法评论。

回答by Carl Manaster

I have used only JExcelAPI, and found it quite usable and solid. Encountered one weirdness, but it was in writing, not reading, and is clearly documented (with solution) in their FAQ, so - happy to recommend it.

我只使用过 JExcelAPI,发现它非常有用和可靠。遇到了一个奇怪的问题,但它是书面的,而不是阅读的,并且在他们的常见问题解答中有清楚的记录(带有解决方案),所以 - 很高兴推荐它。

回答by johnnyshredder

FWIW and Extentech - the makers of OpenXLS - released a new version that now supports adding formulas and executing them like so:

FWIW 和 Extentech - OpenXLS 的制造商 - 发布了一个新版本,现在支持添加公式并像这样执行它们:

CellHandle cx = sheet.add("=sum(a1+a2)","b1");
String val = cx.getFormulaHandle().getFormattedValue();

Also, you will find that Sheetster.comis an open source web spreadsheet from Extentech and you can embed a nice web spreadsheet in your web apps.

此外,您会发现Sheetster.com是来自 Extentech 的开源网络电子表格,您可以在您的网络应用程序中嵌入一个漂亮的网络电子表格。