Bug 46143

Summary: setLineStyleColor for comments donot work
Product: POI Reporter: Vinu Kumar <vinu.kumar>
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   

Description Vinu Kumar 2008-11-04 00:49:39 UTC
setLineStyleColor on a comment is not working.
See the following code. Added setLineStyle to the sample for creating Comments.

http://poi.apache.org/hssf/quick-guide.html 

            HSSFComment comment2 = patr.createComment(new HSSFClientAnchor(0, 0, 0, 0, (short)4, 8, (short) 6, 11));
            //modify background color of the comment
            comment2.setFillColor(204, 236, 255);

            HSSFRichTextString string = new HSSFRichTextString("Normal body temperature");

            //apply custom font to the text in the comment
            HSSFFont font = wb.createFont();
            font.setFontName("Arial");
            font.setFontHeightInPoints((short)10);
            font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
            font.setColor(HSSFColor.RED.index);
            string.applyFont(font);

            comment2.setString(string);
            //by default comments are hidden. This one is always visible.
            comment2.setVisible(true);

            comment2.setAuthor("Bill Gates");
            comment2.setLineStyle(HSSFTextbox.LINESTYLE_DOTGEL);
            comment2.setLineStyleColor(255,0,10);
            /**
             * The second way to assign comment to a cell is to implicitly specify its row and column.
             * Note, it is possible to set row and column of a non-existing cell.
             * It works, the commnet is visible.
             */
            comment2.setRow(6);
            comment2.setColumn((short)1);
Comment 1 Evgeniy Berlog 2012-08-18 20:24:18 UTC
This problem should be fixed in trunk.

Please try with a nightly build - see download links on http://poi.apache.org/
or build yourself from SVN trunk, see http://poi.apache.org/subversion.html