Best way to export data from Java to MS Excel

I might be late to answer this, but I guess your correct choice would be Jxls. I faced a similar scenario in my module where I had to retain a certain template like logo,color,col-span,fixed column... So that's very hectic to write a separate java code and design it.

Jxls core is poi and syntactically similar to jstl, all you need is to map a array-list of bean with desired column in excel


Why so complicated?

Just TAB separate your columns and write the output to plain text file with an ".xls" extension?

That way, all you need to do is open the generated ".xls" file. Even though it's actually just a TAB-separated text file, Excel will open it and automatically treat each tab as a new column.

No idea why people still use csv files, frankly.

Tags:

Java

Excel