poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48779] New: XSSFCellStyle.getFillForegroundColor dosn't return the right value
Date Fri, 19 Feb 2010 15:04:25 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48779

           Summary: XSSFCellStyle.getFillForegroundColor dosn't return the
                    right value
           Product: POI
           Version: 3.6
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
        AssignedTo: dev@poi.apache.org
        ReportedBy: AndrejRW@tut.by


If you try to get a color from a cell which has a non-empty color, you always
get black color independently of what is the right color of the cell. This bug
can be reproduced only for Excel 2007 formats. For '.xls' files it's not
reproducible. 

So if you run the following code for the attached files:
    public static void main(String[] args) {
        Workbook workbook = null;
        try {
            workbook = new XSSFWorkbook("C:/Test.xlsx");
            System.out.println("Cell color in Excel 2007: " + 
                    workbook.getSheetAt(0).getRow(0).getCell(0)
                        .getCellStyle().getFillForegroundColor());
        } catch (IOException e) {
            e.printStackTrace();
        }

        try {
            workbook = new HSSFWorkbook(new FileInputStream("C:/Test.xls"));
            System.out.println("Cell color in Excel 2003: " + 
                    workbook.getSheetAt(0).getRow(0).getCell(0)
                        .getCellStyle().getFillForegroundColor());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

you will see the following output:
Cell color in Excel 2007: 0
Cell color in Excel 2003: 10

Thanks,
Andrej

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


Mime
View raw message