Bug 55406

Summary: PatternFormatting.getFillBackgroundColor() returns 0 for conditional formatting with a pattern
Product: POI Reporter: Dmitriy Chernyavsky <dmitriyc>
Component: XSSFAssignee: POI Developers List <dev>
Severity: normal    
Priority: P2    
Version: 3.9-FINAL   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Attachments: A file that contains conditional formatting in cells A1 and A2

Description Dmitriy Chernyavsky 2013-08-12 22:09:00 UTC
Created attachment 30725 [details]
A file that contains conditional formatting in cells A1 and A2

I use the following formula based conditional formatting:
The formula is ISEVEN(ROW()),
the applied style is "No font formatting, grey background color with solid fill pattern, auto foreground color". 
This makes every other row filled with solid grey color when rows are copied. The font settings are kept by default.

However, while I tried to read the spreadsheet using Apache POI I noticed that
getFillForegroundColor() returns the correct color (64=AUTO) but 
conditionalFormattingRule.getPatternFormatting().getFillBackgroundColor() returns 0 instead of a valid color (index). 

I've attached the sample to the bug
Comment 1 Dominik Stadler 2015-09-13 12:29:48 UTC
In the description above you state getFillForeground... and getFillBackground.., Forground/Background! Please note that these are different things in the XLSX, if I look at the values that I get out of getFillForeground... it looks ok both for normal styles and conditional formatting styles, i.e. I get back color 0 for the normal cell style and color 64 for the conditional cell style.

Please reopen if this is still a problem for you.