You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/11/21 06:02:32 UTC

DO NOT REPLY [Bug 52219] New: XSSFTextBox cannot show font color and size

https://issues.apache.org/bugzilla/show_bug.cgi?id=52219

             Bug #: 52219
           Summary: XSSFTextBox cannot show font color and size
           Product: POI
           Version: 3.8-dev
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: wangxujiajia@126.com
    Classification: Unclassified


My Test File

import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Drawing;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
import org.apache.poi.xssf.usermodel.XSSFColor;
import org.apache.poi.xssf.usermodel.XSSFDrawing;
import org.apache.poi.xssf.usermodel.XSSFFont;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFTextBox;

public class TestXSSFTextBox{
    public static void main(String[] args) throws IOException{
        Workbook wb = new XSSFWorkbook();
        Sheet sheet=wb.createSheet();
        Drawing drawing2 =sheet.createDrawingPatriarch();
        CreationHelper helper = wb.getCreationHelper();
        XSSFClientAnchor a1 = (XSSFClientAnchor) helper.createClientAnchor();
        a1.setRow1(0);
        a1.setRow2(5);
        a1.setCol1(0);
        a1.setCol2(5);

        XSSFTextBox textbox2 =((XSSFDrawing) drawing2).createTextbox(a1);
        XSSFRichTextString str = new XSSFRichTextString("Fontcolor is white!You
can not reset it!");
        XSSFFont font = (XSSFFont) wb.createFont();
        XSSFColor col=new XSSFColor(new java.awt.Color(0, 0, 255));
        font.setColor(col);
        font.setItalic(true);
        font.setFontName("sss");
        font.setBold(true);
        str.applyFont(font);
        textbox2.setText(str);
        textbox2.setNoFill(true);

        String file = "c:\\111.xlsx";
        FileOutputStream fileOut = new FileOutputStream(file);
        try{
            wb.write(fileOut);
        }finally{
            fileOut.close();
        }
    }
}

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 52219] XSSFTextBox cannot show font color and size

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52219

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
         OS/Version|                            |All

--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2011-12-19 08:27:15 UTC ---
It was a bug in XSSF: setting font color and size had no effect because not all
text attributes were copied to xml. 

Should be fixed in r1220642.


Regards,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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