2
版本号是
我自己定义的handler //列宽 public static SimpleColumnWidthStyleStrategy columnWidth = new SimpleColumnWidthStyleStrategy(27);
//行高
public static SimpleRowHeightStyleStrategy rowHeight = new SimpleRowHeightStyleStrategy(new Short("28"), new Short("40"));
//合并单元格
public static OnceAbsoluteMergeStrategy onceAbsoluteMergeStrategy =
new OnceAbsoluteMergeStrategy(0, 1, 0, 1);
//单元格样式
private static List<WriteCellStyle> contentWriteCellStyleList = new ArrayList<>(Lists.newArrayList(getCustomerCellStyle()));
public static HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(new WriteCellStyle(), contentWriteCellStyleList);
private static WriteCellStyle getCustomerCellStyle() {
WriteCellStyle cellStyle = new WriteCellStyle();
cellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
cellStyle.setFillForegroundColor(IndexedColors.WHITE.index);
cellStyle.setBorderBottom(BorderStyle.THIN);
cellStyle.setBorderLeft(BorderStyle.THIN);
cellStyle.setBorderRight(BorderStyle.THIN);
cellStyle.setBorderTop(BorderStyle.THIN);
cellStyle.setBottomBorderColor(IndexedColors.BLACK1.index);
cellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
cellStyle.setWrapped(true);
return cellStyle;
}
你的自定义样式里面设置底部边框颜色的代码删掉看看,边框颜色默认就是黑色的啊. cellStyle.setBottomBorderColor(IndexedColors.BLACK1.index);