You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Rafael Ribeiro Rezende <ra...@gmail.com> on 2012/04/19 23:53:50 UTC

Get colors from Conditional Formatted cell using Apache POI

Hi all,

I'm using Apache POI and I have now the following situation:

Some specific cells from my .xls file has a conditional formatting to set
the font color as red depending on the comparison between two other cells.
This conditional is set through Excel and I just need to read the file with
respective formatting.

If I try to get the resulting color by using a regular procedure, I get the
default color instead, as someone already questioned before
here<http://apache-poi.1045710.n5.nabble.com/POI-HSSFSheetConditionalFormatting-can-t-read-font-color-of-the-specified-cell-td5019187.html>
.

I've found many examples on how to create a conditional formatting, but how
to evaluate the conditions and get the right resulting color? I didn't
understand if "*You'll need **to do any conditional formatting work yourself
*" means that I have to retrieve the condition, write it to a Cell,
evaluate it, and then apply the conditional formatting according to its
result...

Isn't there any straightforward to evaluate it?


Thanks in advance!
-- 
Rafael R R