Yesterday I found this How-To on exporting data to Excel spreadsheets by simply producing HTML. Seemed like a straightforward way of exporting cells with formatting, what one can not achieve using just CSV format.
My idea was to process some data in a Java app, export the results to Excel spreadsheet and make use of Excel's capabilities to further analyse the data, draw charts etc... (avoid re-implementing Excel's powerful features). However, before I export the data I wanted to color the background of some of the cells. The 'conditional formatting' feature of Excel would not suffice (plus, I don't want to do that manually). I find it rather convenient to prepare the spreadsheet with all formatting in the Java app and go from there in Excel.
The approach mentioned in the How-To, is simple and works well, except for two problems. I was hoping some of you may have previous experience with this and will be able to provide some light into this issue.
Coloring the individual cells like
<td bgcolor="#ff2323">
will look exactly the way I want when I open the XLS file in Firefox, but Excel changes the colors to what I believe they call 'web-safe' color palette. Which means, instead of having 256 different shades of red, I get a 'red', 'fuchsia', 'pink', 'orange', 'light yellow' and 'white'. Is there any way to stop this color conversion from happening?When I open the XLS file (which in reality is just HTML on the inside), all looks good but the thin grey lines separating individual cells are gone and I can't figure out how to 'turn them on'. What's with that?
Problem 1 is the main issue which I would really like to solve.