/** * Removes the comment for this cell, if there is one. */ @Override public void removeCellComment() { XSSFComment comment = getCellComment(); if(comment != null){ CellAddress ref = new CellAddress(getReference()); XSSFSheet sh = getSheet(); sh.getCommentsTable(false).removeComment(ref); sh.getVMLDrawing(false).removeCommentShape(getRowIndex(), getColumnIndex()); } }
/** * Removes the comment for this cell, if there is one. */ public void removeCellComment() { XSSFComment comment = getCellComment(); if(comment != null){ String ref = _cell.getR(); XSSFSheet sh = getSheet(); sh.getCommentsTable(false).removeComment(ref); sh.getVMLDrawing(false).removeCommentShape(getRowIndex(), getColumnIndex()); } }
/** * Removes the comment for this cell, if there is one. */ @Override public void removeCellComment() { XSSFComment comment = getCellComment(); if(comment != null){ CellAddress ref = new CellAddress(getReference()); XSSFSheet sh = getSheet(); sh.getCommentsTable(false).removeComment(ref); sh.getVMLDrawing(false).removeCommentShape(getRowIndex(), getColumnIndex()); } }
cellNew.setCellComment(cellOld.getCellComment());
/** * 功能:拷贝comment * @param targetCell * @param sourceCell * @param targetPatriarch */ public static void copyComment(SXSSFCell targetCell,XSSFCell sourceCell,Drawing targetPatriarch)throws Exception{ if(targetCell == null || sourceCell == null || targetPatriarch == null){ throw new IllegalArgumentException("调用PoiUtil.copyCommentr()方法时,targetCell、sourceCell、targetPatriarch都不能为空,故抛出该异常!"); } //处理单元格注释 Comment comment = sourceCell.getCellComment(); if(comment != null){ Comment newComment = targetPatriarch.createCellComment(new XSSFClientAnchor()); newComment.setAuthor(comment.getAuthor()); newComment.setColumn(comment.getColumn()); newComment.setRow(comment.getRow()); newComment.setString(comment.getString()); newComment.setVisible(comment.isVisible()); targetCell.setCellComment(newComment); } }
public XLSXCellNode(XSSFSheet sheet,XSSFCell cell,int index,XLSXExpression expression) { super(sheet,cell,expression); assert cell != null : "null cell" ; if(cell.getCTCell().isSetF()){ formulaStringValue = cell.getCTCell().getF().getStringValue(); } colRef = CellReference.convertNumToColString(index); int rowRef = getCell().getRowIndex() + 1; absoluteRef = colRef + rowRef; if(cell.getCTCell().isSetS()){ s = cell.getCTCell().getS(); } workbookPr = getSheet().getWorkbook().getCTWorkbook().getWorkbookPr(); comment = cell.getCellComment(); if(comment != null){ commnetExpr = CellExpressionParser.parseExpression(comment.getString().getString()); } }
continue; XSSFComment cellComment = tplSheetCell.getCellComment(); if (cellComment != null) sheetCell.setCellComment(cellComment);