Created attachment 38438 [details] Expected borders and reality Hi there, I'm facing an issue trying to set borders on an merged region applying a Row Span. The version I uesd is 5.2.3 but not listed here. the code used bellow : if (!BorderStyle.NONE.equals(excelStyle.getBorderBottom())) { RegionUtil.setBorderBottom(excelStyle.getBorderBottom(), mergedRegion, excelSheet); RegionUtil.setBottomBorderColor(excelStyle.getBottomBorderColor(), mergedRegion, excelSheet); } if (!BorderStyle.NONE.equals(excelStyle.getBorderTop())) { RegionUtil.setBorderTop(excelStyle.getBorderTop(), mergedRegion, excelSheet); RegionUtil.setTopBorderColor(excelStyle.getTopBorderColor(), mergedRegion, excelSheet); } if (!BorderStyle.NONE.equals(excelStyle.getBorderLeft())) { RegionUtil.setBorderLeft(excelStyle.getBorderLeft(), mergedRegion, excelSheet); RegionUtil.setLeftBorderColor(excelStyle.getLeftBorderColor(), mergedRegion, excelSheet); } if (!BorderStyle.NONE.equals(excelStyle.getBorderRight())) { RegionUtil.setBorderRight(excelStyle.getBorderRight(), mergedRegion, excelSheet); RegionUtil.setRightBorderColor(excelStyle.getRightBorderColor(), mergedRegion, excelSheet); } In my tests i go throughout all conditions, this works good for the Column span, But for the Row span the behavior of the borders isn't the one I expected (see the attachments). The script of the code is this : - I compute the XSSFCellStyle - Then I apply the style to the current cell - And finaly, if a span is defined on this cell, I create a CellRangeAddress, add it to the merged regions and apply the borders with the code above. I try differents scripts (create the merged region before applying styles...) but the result is always the same as the attachment. Is this a bug or I missused RegionUtil ? Thanks.
I there, I tried many solutions but it seems that I made a mistake using RegionUtil with XSSF styles. I fix all my borders issues (style and colors) by setting the style wanted in all the cell being part of the merged region (before that, I only created the first cell of the merged region, applied the style to it and then created the merged region and I think this is the problem) I close the issue.