poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 61728] New: Cell Comments created with Apache POI have transparent background
Date Mon, 06 Nov 2017 13:18:24 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=61728

            Bug ID: 61728
           Summary: Cell Comments created with Apache POI have transparent
                    background
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: c0ff75@gmail.com
  Target Milestone: ---

Created attachment 35497
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35497&action=edit
I use this file to add cells with comments

I am using Apache POI 3.17 to create cell comments.

I have a need to add cell comments to XSSF sheets.

I have tried the code, suggested in POI FAQ. But my cell comments have 
transparent background.

The code is reproduced below.

protected void setCellComment(Cell cell, String message) {
    Drawing drawing = cell.getSheet().createDrawingPatriarch();
    CreationHelper factory = cell.getSheet().getWorkbook()
            .getCreationHelper();
    // When the comment box is visible, have it show in a 1x3 space
    ClientAnchor anchor = factory.createClientAnchor();
    anchor.setCol1(cell.getColumnIndex());
    anchor.setCol2(cell.getColumnIndex() + 1);
    anchor.setRow1(cell.getRowIndex());
    anchor.setRow2(cell.getRowIndex() + 1);
    anchor.setDx1(100);
    anchor.setDx2(100);
    anchor.setDy1(100);
    anchor.setDy2(100);

    // Create the comment and set the text+author
    Comment comment = drawing.createCellComment(anchor);
    RichTextString str = factory.createRichTextString(message);
    comment.setString(str);
    comment.setAuthor("Apache POI");
    // Assign the comment to the cell
    cell.setCellComment(comment);
}
How can I change the background to a yellow background?

NOTE: If one edits the apache-poi created comment in Excel, then it will appear
with a yellow background temporarily. However if one tries to format this
comment to change the background from within Excel, then one can't. (The Color
and Lines menu does not appear)

-- 
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