https://issues.apache.org/bugzilla/show_bug.cgi?id=56852
Bug ID: 56852
Summary: add the comment large than 1024, the excel will only
display the last 1024 comments
Product: POI
Version: 3.10-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
Assignee: [email protected]
Reporter: [email protected]
hello,
Our project will need to import the excel for some data init. cell will be
added the comment about the reasons of error, so there may be add more than
1024 comments, but will only display the last 1024.
e.g.
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("mysheet");
HSSFPatriarch p = null;
final Map<HSSFSheet, HSSFPatriarch> drawings = new HashMap<HSSFSheet,
HSSFPatriarch>();
if(drawings.containsKey(sheet)) {
p = drawings.get(sheet);
} else {
p = sheet.createDrawingPatriarch();
}
for (int i = 0; i < 2000; i++) {
HSSFCell cell = sheet.createRow(i).createCell(1);
cell.setCellValue(new HSSFRichTextString("comment" + i));
HSSFAnchor anchor = new HSSFClientAnchor(0, 0, 0, 0, (short) 1, i, (short) 3,
i + 3);
HSSFComment comment = p.createComment(anchor);
comment.setAuthor("fzb");
comment.setString(new HSSFRichTextString("add the comment" + i +
"success!"));
cell.setCellComment(comment);
}
FileOutputStream out = new FileOutputStream("writerPostil.xls");
wb.write(out);
Regards
--
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]