Bogdan M.
Bogdan M.

Reputation: 2181

Java tabled output to file

I'm interested in a way of outputting some objects to a table like way the objects. Concrete example would be something like:

-------------------------------------------
|  Name      |     foo     |      bar     |
-------------------------------------------
| asdas      | dsfsd       |1233.23       |
| adasdasd   | fsdfs       |3.23          |
| sdasjd     | knsdfsd     |13.23         |
| lkkkj      | dsfsd       |2343.23       |
-------------------------------------------   

Or an ms office / open office excel file.(is there an api doc for this type of outputting data in specific editors? like how to define a table in OpenPffice)?

I'm asking this because I would like to know the best way doing this. PS: there is no need to deserialise.

Upvotes: 1

Views: 67

Answers (2)

Garrett Hall
Garrett Hall

Reputation: 30022

The easiest is to export to a comma-separated values which you can open in Excel.

You can use the data-exporter library.

Upvotes: 1

KyelJmD
KyelJmD

Reputation: 4732

docx4j is a library for creating and manipulating .docx,pptx and excel files.

If you do not feel like using docx4java or it does not fit your needs you can try these

Upvotes: 2

Related Questions