[Bug 61728] New: Cell Comments created with Apache POI have transparent background

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 61728] New: Cell Comments created with Apache POI have transparent background

Bugzilla from bugzilla@apache.org
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: [hidden email]
          Reporter: [hidden email]
  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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61728] Cell Comments created with Apache POI have transparent background

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61728

Evgenii Balakhonov <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
                 OS|                            |All

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61728] Cell Comments created with Apache POI have transparent background

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61728

--- Comment #1 from Javen O'Neal <[hidden email]> ---
What version of Excel are you using?

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61728] Cell Comments created with Apache POI have transparent background

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61728

--- Comment #2 from Evgenii Balakhonov <[hidden email]> ---
Created attachment 35498
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35498&action=edit
Example of generated file with transparent comments

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61728] Cell Comments created with Apache POI have transparent background

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61728

--- Comment #3 from Evgenii Balakhonov <[hidden email]> ---
(In reply to Javen O'Neal from comment #1)
> What version of Excel are you using?

Excel 2013. I attached generated file with example of transparent comments.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

[Bug 61728] Cell Comments created with Apache POI have transparent background

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=61728

--- Comment #4 from PJ Fanning <[hidden email]> ---
I added the first comment using Excel and the other one was already in
comment-example.xlsm. The first comment appears as black text on a yellow
background while the other one appears as black text on a transparent
background.

   <comment ref="B178" authorId="1">
        <text>
            <r>
                <rPr>
                    <b/>
                    <sz val="10"/>
                    <color indexed="81"/>
                    <rFont val="Calibri"/>
                </rPr>
                <t>xxx123xxx</t>
            </r>
            <r>
                <rPr>
                    <sz val="10"/>
                    <color indexed="81"/>
                    <rFont val="Calibri"/>
                </rPr>
                <t xml:space="preserve">
                </t>
            </r>
        </text>
    </comment>
    <comment ref="B191" authorId="0">
        <text>
            <r>
                <rPr>
                    <sz val="11"/>
                    <color theme="1"/>
                    <rFont val="Calibri"/>
                    <family val="2"/>
                    <charset val="204"/>
                    <scheme val="minor"/>
                </rPr>
                <t>Страна происхождения, где товар был изготовлен или
обработан. Пример заполнения: Сделано в Германии. Данная информация
отображается на упаковке товара.</t>
            </r>
        </text>
    </comment>

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]