I have written code for color formatting for excel using Apache POI. The formatting for color and font came nicely in MS Excel 2010. But it does not have compatibility with excel 2003. The formatting is not there when the file opened in MS Excel 2003.
Here the sample code:
CellStyle style = getWorkbook().createCellStyle();
Font font = wb.createFont();
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
font.setFontHeightInPoints((short)11);
style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
style.setFillPattern(CellStyle.SOLID_FOREGROUND);
Cell cell = excelRow.createCell(10);
cell.setCellStyle(style);
If any suggestions, let me know.