Bug 55406 - PatternFormatting.getFillBackgroundColor() returns 0 for conditional formatting with a pattern
Summary: PatternFormatting.getFillBackgroundColor() returns 0 for conditional formatti...
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.9-FINAL
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-12 22:09 UTC by Dmitriy Chernyavsky
Modified: 2015-09-13 12:29 UTC (History)
0 users



Attachments
A file that contains conditional formatting in cells A1 and A2 (12.35 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2013-08-12 22:09 UTC, Dmitriy Chernyavsky
Details

Note You need to log in before you can comment on or make changes to this bug.
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.