为什么我利用poi给excel的单元格添加批注后只有一行出现了批注?
代码如下:
private void contentsingleedit(HSSFPatriarch p,int i,String text,HSSFCellStyle style,HSSFRow row) { WBSExcelUtils.createCell(row, i); HSSFComment commentglqf=p.createComment(new HSSFClientAnchor(0,0,0,0,(short)3,3,(short)4,8)); HSSFComment commenttjqf=p.createComment(new HSSFClientAnchor(0,0,0,0,(short)3,3,(short)4,8)); commentglqf.setString(glqfstr); commenttjqf.setString(tjqfstr); HSSFCell cell = WBSExcelUtils.getCell(row, i); cell.setCellStyle(style); cell.setCellValue(text); if(i==7) { cell.setCellComment(commentglqf); } else if(i==8){ cell.setCellComment(commenttjqf); } }
if(i==7) { cell.setCellComment(commentglqf); } else if(i==8){ cell.setCellComment(commenttjqf); }