开发者

What is the best way to write an excel file from Java? [closed]

开发者 https://www.devze.com 2023-02-07 23:58 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_如何学JAVA

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 8 years ago.

Improve this question

What library would you guys recommend to write an excel file from Java? It has to be pure Java solution, so it will work on any platform.

Thanks, Grae

EDIT: It can't be CSV file format. It has to have column headers, data format type, etc.


The best solution I've found for generating Microsoft document formats is the Apache POI library: http://poi.apache.org/


Starting with MS Office 2007 Excel files are saved in Office Open XML (.xlsx) by default. Create such file with any content, rename it to .zip and look inside. It's a bunch of folders and XML files compressed together.

Java provides support for creating zip files using java.util.zip. And that's all you need.

0

精彩评论

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