List of usage examples for org.apache.poi.xssf.usermodel XSSFCell removeCellComment
@Override public void removeCellComment()
From source file:offishell.excel.Excel.java
License:MIT License
public Excel calculate(Object model) { Map<CellAddress, XSSFComment> cellComments = sheet.getCellComments(); VariableContext context = new VariableContext(path, false, model); for (Iterator<Entry<CellAddress, XSSFComment>> iterator = cellComments.entrySet().iterator(); iterator .hasNext();) {//from w w w . j a v a 2s. c o m Entry<CellAddress, XSSFComment> entry = iterator.next(); CellAddress address = entry.getKey(); String comment = entry.getValue().getString().getString().strip(); entry.getValue().setVisible(false); XSSFCell cell = sheet.getRow(address.getRow()).getCell(address.getColumn()); cell.setCellValue(context.apply(comment)); cell.removeCellComment(); } try { return save(Files.createTempFile("calculated", ".xlsx")); } catch (IOException e) { throw I.quiet(e); } }