// 合并单元格 sheet.addMergedRegion(new CellRangeAddress(0,1,2,4); // 参数 合并0行到1行,2列到4列区域
// 设置合并单元格后表格边框 setRegionBorder(1,new CellRangeAddress(0,1,2,4),sheet,workbook);
/** * 设置合并单元格后表格边框 * @param border 边框宽度 * @param region 合并区域 * @param sheet HSSFSheet * @param wb HSSFWorkbook * @return void 返回参数说明 * @exception/throws */ public static void setRegionBorder(int border, CellRangeAddress region, HSSFSheet sheet, HSSFWorkbook wb){ RegionUtil.setBorderBottom(border,region,sheet,wb); RegionUtil.setBorderLeft(border,region,sheet,wb); RegionUtil.setBorderRight(border,region,sheet,wb); RegionUtil.setBorderTop(border,region,sheet,wb); }