当前页面: 开发资料首页 → JSP 专题 → poi设置边框
poi设置边框
摘要: poi设置边框
合并单元格时,只有第一格边框可以设置成为黑色,是怎么回事?
??
你的代码是怎么写的
我的代码:
HSSFCellStyle cs1 = wb.createCellStyle();
cs1.setBorderBottom(HSSFCellStyle.BORDER_THIN);
cs1.setBorderLeft(HSSFCellStyle.BORDER_THIN);
cs1.setBorderRight(HSSFCellStyle.BORDER_THIN);
cs1.setBorderTop(HSSFCellStyle.BORDER_THIN);
HSSFRow titlerow = sheet.createRow(rowIndex);
titlerow.setHeight((short)0x200);
HSSFCell titlecell = titlerow.createCell((short)0);
titlecell.setEncoding(HSSFCell.ENCODING_UTF_16);
titlecell.setCellValue(title);
sheet.addMergedRegion(new Region((short)0,(short)0,(short)0,(short)10));
titlecell.setCellStyle(cs1);
按理说合并成大单元格后应该四周有边框才对,但现在出不来,我到底哪里写错啦?
大家请帮帮我吧~
ok,搞定,呵呵~