I am trying to create cells comments using apache poi. I am able to create the comments, but by default they are always displayed in excel. I have to manual right click on the cell and un-tick show comments to make them invisible(now they appear only when I hover on the cell). Is it possible to make cell comments invisible by default(so that they don't appear in the excel until user hover over the cell.)
Here is the code I used :
Drawing drawing = cell.getSheet().createDrawingPatriarch();
CreationHelper factory = cell.getSheet().getWorkbook().getCreationHelper();
ClientAnchor anchor = factory.createClientAnchor();
anchor.setCol1(cell.getColumnIndex());
anchor.setCol2(cell.getColumnIndex() + 1);
anchor.setRow1(cell.getRowIndex());
anchor.setRow2(cell.getRowIndex() + 3);
Comment comment = drawing.createCellComment(anchor);
RichTextString str = factory.createRichTextString(message);
comment.setVisible(Boolean.FALSE);
comment.setString(str);
cell.setCellComment(comment);