学习 Java 的 Apache POI
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2253779/
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
Learning Apache POI for Java
提问by froadie
I'm trying to learn Apache POI for Java quickly (for manipulating Excel). I've been googling for tutorials, but so far all I've found is short, 2-paragraph explanations followed by a code sample. I wanted to find something a bit more comprehensive, that is concise but walks through it in a structured, complete, and understandable way. Anyone know of any good tutorials? Does Apache POI have any decent documentation...? I couldn't seem to find any on their site.
我正在尝试快速学习 Java 的 Apache POI(用于操作 Excel)。我一直在谷歌上搜索教程,但到目前为止,我发现的只是简短的两段解释,然后是代码示例。我想找到一些更全面的东西,即简洁但以结构化、完整和易于理解的方式进行介绍。有谁知道有什么好的教程吗?Apache POI 是否有任何像样的文档...?我似乎无法在他们的网站上找到任何内容。
回答by James
I found the documentation to be mostly lacking myself. I found the mailing group was my best resource for getting answers to my hard questions: http://mail-archives.apache.org/mod_mbox/poi-user/. For learning the basics I just followed the examples on the online documentation and used the trial and error approach with a simple console app.
我发现文档主要是我自己缺乏。我发现邮件组是我获得难题答案的最佳资源:http: //mail-archives.apache.org/mod_mbox/poi-user/。为了学习基础知识,我只是按照在线文档中的示例进行操作,并在一个简单的控制台应用程序中使用了试错法。
Online documentation links:
在线文档链接:
http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFSheet.html
http://poi.apache.org/apidocs/org/apache/poi/xssf/usermodel/XSSFSheet.html
回答by Carl Smotricz
I'm a bit late to this party but another resource that hasn't been mentioned so far is the example code within POI's own source tree. I'm working with the Word functionality (HWPF) and found some nicely functioning code for using POI to do conversions to text, FO, and HTML. Following the source (which is unfortunately also not very commented) gave me a lot of useful hints.
我参加这个聚会有点晚了,但到目前为止还没有提到的另一个资源是 POI 自己的源代码树中的示例代码。我正在使用 Word 功能 (HWPF),并找到了一些运行良好的代码,用于使用 POI 进行文本、FO 和 HTML 的转换。遵循来源(不幸的是也没有得到很好的评论)给了我很多有用的提示。
回答by Carl Smotricz
There is EXCELENT tutorial on YouTube. Consists of 10 videos, I think. Just type in "Java programming tutorial - excel documents"
YouTube 上有优秀的教程。我认为由 10 个视频组成。只需输入“Java编程教程-excel文档”
回答by duffymo
I prefer Andy Khan's JExcel to POI. It's a better API, and the docs are very good.

