合并单元格边框样式消失

1、前置条件(合并前的单元格边框必须存在)

2、设置合并单元格样式

XSSFSheet sheet;
CellRangeAddress cellRangeAddress = new CellRangeAddress(startRow, overRow, startCol, overCol);
sheet.addMergedRegion(cellRangeAddress);
RegionUtil.setBorderBottom(BorderStyle.THIN, cellRangeAddress, sheet);
RegionUtil.setBorderLeft(BorderStyle.THIN, cellRangeAddress, sheet);
RegionUtil.setBorderRight(BorderStyle.THIN, cellRangeAddress, sheet);
RegionUtil.setBorderTop(BorderStyle.THIN, cellRangeAddress, sheet);

posted @ 2022-11-23 14:01  懂得归零  阅读(672)  评论(1编辑  收藏  举报