Hi POI users!

I am in the process of setting up a conditional formatting rule, which will
go into a programmatically exported Excel 97-compatible workbook.

The rule is: If cell #1 has a value, then cell #2 must have a value as well. 
If it does not, color cell #2 red.

In Excel, it translates into:
1) If cell #1 is blank, clear the formatting on cell #2, stop if true.
2) If cell #2 is blank, apply red background on cell #2, stop if true.

I had already created the rule in Excel and tested it successfully.  Knowing
it can work, I proceeded to code a method that would insert the rule in the
sheet.

Below is a simplified version of what I have done:



The Excel is generated such that the rules are always obeyed.

Now for the problem: *The rules have been created, but they are not
enforced.*  If I go into the generated workbook and attempt to break the
rule, nothing happens.  However, if I go into the workbook, choose to edit
each rule of the conditional formatting and click OK, then the rules go in
force.

Thus, I must obviously be missing a little something in my procedure to
"plug-in" the rules, but I can't put my finger on it, and Google has
unfortunately been of little help...  Pointers are greatly appreciated.

Bonus question: I haven't come across anything in POI that allows me to
change the "stop if true" property, so I guess I can count myself lucky that
it's what I wanted anyway?

--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/HSSF-Conditional-formatting-not-enforced-how-to-turn-it-on-tp4694554p4694554.html
Sent from the POI - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to