Has anyone used a Java based library for generating excel documents? Preferably support for 2003?
Whenever I have to do this I ask myself if one big html table would be enough.
much of the time it is. You can simply write html tags and label it as a .xls file. Excel will open it correctly
JExcelApi
I've used it personally for a report that is currently in production. It's a fairly decent library with sufficient docs, and it's open source.
It works very well, but has a few gotchas you should be aware of. None of them are deal breakers, just dictate how a few things should be done. Just be sure to read the FAQ. It will explain them and tell you how to avoid them.
A formatted HTML table will import correctly, but it would be better to use the Excel XML format from the Excel 2003 XML Toolbox for more advanced needs (multiple worksheets, formulas, etc).
I'm currently working with Apache POI, ( http://poi.apache.org/index.html ) which is very comprehensive. The 2003 file format version is still in beta, but seems to work well enough. I'm not exercising it's power very much, just straightforward reads and writes of Excel, but it seems reliable.
You can also try SmartXLS for java, it have more functions than poi and jexcelapi,and it is a commercial product.