【发布时间】:2016-06-29 19:47:52
【问题描述】:
我使用的是 poi 3.14,我想要的只是将单元格的背景设置为橙色。我不想要填充图案,只想要一个纯橙色,但我无法让它工作。这是我所拥有的:
Row row = sheet.createRow(currentRow);
CellStyle style = workbook.createCellStyle();
style.setFillForegroundColor(IndexedColors.AUTOMATIC.getIndex());
style.setFillBackgroundColor(IndexedColors.ORANGE.getIndex());
style.setFillPattern(CellStyle.ALIGN_FILL);
Cell cell = row.createCell(0);
cell.setCellValue("ABCDEFG");
cell.setCellStyle(style);
我最终得到的是带有small dots 图案的橙色背景。在 Excel 的属性表上,它说我有bg=orange, fg=automatic, pattern=25% Gray。如何使用简单的空白图案样式?
【问题讨论】:
标签: java excel apache-poi