poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59388] setComment with option isVisible
Date Wed, 25 May 2016 10:19:43 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=59388

--- Comment #6 from ORLANDI <orlandi.m70@gmail.com> ---
Here's the code:

/* ... */

XSSFWorkbook w = new XSSFWorkbook();
w.createSheet();

Comment commentToInsert = null;

ClientAnchor anchorForComment = w.getCreationHelper().createClientAnchor();
anchorForComment.setAnchorType(3);
anchorForComment.setCol1(1);
anchorForComment.setCol2(4);
anchorForComment.setRow1(1);
anchorForComment.setRow2(4);
anchorForComment.setDx1(100);
anchorForComment.setDx2(400);
anchorForComment.setDy1(100);
anchorForComment.setDy2(400);

Drawing drawingForComments = w.getSheetAt(0).createDrawingPatriarch();
commentToInsert = drawingForComments.createCellComment(anchorForComment);
commentToInsert.setString(w.getCreationHelper().createRichTextString("Hi!"));

w.getSheetAt(0).createRow(0).createCell(0).setCellComment(commentToInsert);

//Setting cell comment visibility
w.getSheetAt(0).getRow(0).getCell(0).getCellComment().setVisible(true);

/* ... */

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message