https://issues.apache.org/bugzilla/show_bug.cgi?id=44688
Summary: Insertion of multiple comments
Product: POI
Version: 3.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: major
Priority: P1
Component: HSSF
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
I am using the 3.0.1-FINAL version of POI. I was not successful in adding
comments to more than one cell in a loop. I couldn't figure out what is
happening to the comment objects I am creating using the command
HSSFPatriarch.createComment() function. Please look at the code I am using
bellow:
Scenario1:
Created a comment object, added it to the cell in a for loop --> expected
result, all the cells in the excel sheet should have the same comment.
==> Result I am getting: Only the top most cell of the excel sheet is having
the comment. The cell is choosen arbritrarliy at times.
Scenario2:
Created a comment object, added it to the cell. Created another comment object
(but not added to any cell) in a for loop --> expected result: all the cells in
the excel sheet should have the first comment
==> Result I am getting: One cell has the first comment and another has the
second comment (please note, I've never added the second comment to any of the
cells). The selection of the cells is arbitrary at times.
My actual requirement is to add comments to selected cells.
Your help in this regard is highly appreciated.
Code I've used for adding comments :
HSSFPatriarch patr = finalSheet.createDrawingPatriarch();
HSSFCell cell1 = finalSheet.createRow(4).createCell((short)1);
HSSFCell cell = finalSheet.createRow(5).createCell((short)1);
HSSFComment comment1 = patr.createComment(new HSSFClientAnchor(0, 100, 0, 0,
(short)4, 2, (short) 6, 5));
comment1.setString(new HSSFRichTextString("help me"));
comment1.setAuthor("SUMIT");
newCell.setCellComment(comment1);
cell.setCellComment(comment1);
cell1.setCellComment(comment1);
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]