我已经使用 Apache POI 为 excel 编写了颜色格式代码。颜色和字体的格式在 MS Excel 2010 中很好。但它与 excel 2003 不兼容。在 MS Excel 2003 中打开文件时,格式不存在。
这里是示例代码:
    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);
如果有任何建议,请告诉我。