1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > poi excel设置合并单元格边框格式

poi excel设置合并单元格边框格式

时间:2019-02-26 18:12:41

相关推荐

poi excel设置合并单元格边框格式

版本3.17

//设置合并单元格的边框

public static void setBorderForMergeCell(BorderStyle style,int color, CellRangeAddress cra,Sheet sheet){

RegionUtil.setBorderTop(style,cra,sheet);

RegionUtil.setBorderBottom(style,cra,sheet);

RegionUtil.setBorderLeft(style,cra,sheet);

RegionUtil.setBorderRight(style,cra,sheet);

RegionUtil.setTopBorderColor(color,cra,sheet);

RegionUtil.setBottomBorderColor(color,cra,sheet);

RegionUtil.setLeftBorderColor(color,cra,sheet);

RegionUtil.setRightBorderColor(color,cra,sheet);

}

调用

mergeCell(rowId, rowId + rowSkip,

colIndex, colIndex + cellSkip,sheet); // 起始行, 终止行, 起始列, 终止列 // 终止行,

setBorderForMergeCell(BorderStyle.MEDIUM,(short)22,new CellRangeAddress(rowId, rowId + rowSkip,

colIndex, colIndex + cellSkip),sheet);

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。