I\'m using apache poi 3.7 and I need to put border to a range of cells or merged region.
how can I to apply border to a merged region when the sheet and workbook type is
@Jesanagua just saved my life, I just had to change a bit to match 3.17.
private void setBordersToMergedCells(HSSFSheet sheet) {
int numMerged = sheet.getNumMergedRegions();
for (int i = 0; i < numMerged; i++) {
CellRangeAddress mergedRegions = sheet.getMergedRegion(i);
RegionUtil.setBorderLeft(BorderStyle.THIN, mergedRegions, sheet);
RegionUtil.setBorderRight(BorderStyle.THIN, mergedRegions, sheet);
RegionUtil.setBorderTop(BorderStyle.THIN, mergedRegions, sheet);
RegionUtil.setBorderBottom(BorderStyle.THIN, mergedRegions, sheet);
}
}