You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Brian Milnes <br...@xbrlcloud.com> on 2015/11/17 04:07:44 UTC

Correctly getting the color of an XSSFCellStyle

 I've got spreadsheet that has multiple gray cells which are blank
and I'd like to leave blank, and multiple white cells which are blank and I
would like to fill them.

I want to recognize them and not fill them but I can't get the logic right
or I have an issue with 3.13.

 They both can end up with a
SOLID_FOREGROUND fill,
getFillForegroundColor of 0
and getFillFillForgroundColor of ARGB of -1 -1 -1 -1.

 What is the correct way to differentiate empty white versus gray cells?

 Thanks, Brian

Re: Correctly getting the color of an XSSFCellStyle

Posted by Brian Milnes <br...@xbrlcloud.com>.
Folks,

  I know understand the document format better (thanks to work on another
issue) and in styles.xml I can see:

<fills count="44">
    <fill>
      <patternFill patternType="none"/>
    </fill>
    <fill>
      <patternFill patternType="gray125"/>
    </fill>
    <fill>
      <patternFill patternType="solid">
    <fgColor rgb="FFC6EFCE"/>
      </patternFill>
    </fill>...

Which must be the root of my inability to recognize a gray cell.

So XSSFCellStyle has a design problem in that it assuming either a fixed
set of fills or an incomplete
set of fills for the nice enumeration of fills.

 Does anyone know how to fix this? No urgency on my part, my code works
well enough and I have
been able to work around the issues it generates.

Thanks, Brian


On Mon, Nov 16, 2015 at 7:07 PM, Brian Milnes <br...@xbrlcloud.com>
wrote:

>
>  I've got spreadsheet that has multiple gray cells which are blank
> and I'd like to leave blank, and multiple white cells which are blank and
> I would like to fill them.
>
> I want to recognize them and not fill them but I can't get the logic right
> or I have an issue with 3.13.
>
>  They both can end up with a
> SOLID_FOREGROUND fill,
> getFillForegroundColor of 0
> and getFillFillForgroundColor of ARGB of -1 -1 -1 -1.
>
>  What is the correct way to differentiate empty white versus gray cells?
>
>  Thanks, Brian
>
>
>
>
>



-- 
Brian Milnes
CIO XBRL Cloud
206 406 7576