poi做Excel在合并单元格后如何加边框 poi 如果给单个单元格加边框很好解决,可是合并单元格后如何加边框?请各位大虾不吝赐教. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把分给我吧。 region = new Region(allLine - 2, (short) 6, allLine - 2, (short) 8); sheet.addMergedRegion(region); setRegion(region, wk.getCellStyle(CELLSTYLE_7_7_1_7_10_1_2), "節"); public HSSFCellStyle getCellStyle(String key) { if (key == null) { return null; } HSSFCellStyle cellStyle = (HSSFCellStyle) this.map.get(key); if (cellStyle == null) { cellStyle = this.createCellStyle(); newCellStyle(cellStyle, key); this.map.put(key, cellStyle); } return cellStyle; } private void newCellStyle(HSSFCellStyle cellStyle, String key) { String[] params = key.split("_"); cellStyle.setBorderLeft(new Integer(params[0]).shortValue()); cellStyle.setBorderRight(new Integer(params[1]).shortValue()); cellStyle.setBorderTop(new Integer(params[2]).shortValue()); cellStyle.setBorderBottom(new Integer(params[3]).shortValue()); if (!"0".equals(params[4])) { HSSFFont font = ZZExcelUtil.createFontA(this); font.setFontHeightInPoints(new Integer(params[4]).shortValue()); cellStyle.setFont(font); } cellStyle.setVerticalAlignment(new Integer(params[5]).shortValue()); cellStyle.setAlignment(new Integer(params[6]).shortValue()); } 跪求 Java + Oracle数据仓库的 例子 java接口问题 java中如何监听剪贴板? 怎么将string类型转为inputstream类型? JAVA3D问题求救,我快上吊了! 菜鸟问题来这又分,叫个朋友! 高分问个简单的问题 如何在APPLET中随机产生3中大小不同的小球? 想考SCJP,请各位高手接指点,哪本书比较好!! 关于Java的毕业设计课题 自己没有开发工具,请帮忙做一个简单的JAVA应用程序. list里面取随机几个对象问题
region = new Region(allLine - 2, (short) 6, allLine - 2, (short) 8);
sheet.addMergedRegion(region);
setRegion(region, wk.getCellStyle(CELLSTYLE_7_7_1_7_10_1_2), "節");
public HSSFCellStyle getCellStyle(String key) {
if (key == null) {
return null;
} HSSFCellStyle cellStyle = (HSSFCellStyle) this.map.get(key);
if (cellStyle == null) {
cellStyle = this.createCellStyle();
newCellStyle(cellStyle, key);
this.map.put(key, cellStyle);
}
return cellStyle;
} private void newCellStyle(HSSFCellStyle cellStyle, String key) { String[] params = key.split("_");
cellStyle.setBorderLeft(new Integer(params[0]).shortValue());
cellStyle.setBorderRight(new Integer(params[1]).shortValue());
cellStyle.setBorderTop(new Integer(params[2]).shortValue());
cellStyle.setBorderBottom(new Integer(params[3]).shortValue());
if (!"0".equals(params[4])) {
HSSFFont font = ZZExcelUtil.createFontA(this);
font.setFontHeightInPoints(new Integer(params[4]).shortValue());
cellStyle.setFont(font);
}
cellStyle.setVerticalAlignment(new Integer(params[5]).shortValue());
cellStyle.setAlignment(new Integer(params[6]).shortValue());
}