poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56852] New: add the comment large than 1024, the excel will only display the last 1024 comments
Date Thu, 14 Aug 2014 07:21:06 GMT
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: dev@poi.apache.org
          Reporter: silencon@gmail.com

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message