Hi,

Badly stuck on conditional formatting using 3.9 poi !

I am currently working on parsing/reading the xlsx document using apache poi
3.9. I have certain requirement for conditional formatting. The xlsx is
having conditional formulaes set.
Now I need to know whether the cell being read has content which is matching
the conditional formulae match criteria. I have a code which determines
whether the cell being read is falling under the conditional formulae cell
range or not. But beyond that I also need to know that if the cell is
falling under the conditional formulae cell range then does it also match
the conditional expression or not.

How do we determine that ?

Here is the code to determine whether the cell is falling under the
conditional formulae cell range. 



        XSSFSheetConditionalFormatting xscf =
((XSSFSheet)ssRow.getSheet()).getSheetConditionalFormatting();
        for(int idx = 0;idx<xscf.getNumConditionalFormattings();idx++){
           XSSFConditionalFormatting cf =
xscf.getConditionalFormattingAt(idx);
           List&lt;CellRangeAddress> cra =
Arrays.asList(cf.getFormattingRanges());
           List<CellRangeAddress> newCra = new ArrayList();
           for(CellRangeAddress c:cra){
              if(containsCell(c, ssCell)){
                ArrayList<XSSFConditionalFormattingRule> cfs = new ArrayList();
                  for(int ci=0;ci<cf.getNumberOfRules();ci++){
                        ConditionalFormattingRule cfr = cf.getRule(ci);
                                        if 
((null!=cf.getRule(ci).getFontFormatting())){//&&
(cf.getRule(ci).getFontFormatting().isItalic())){
                                                style.getFont().setItalic(true);
                                        }
                  }
              }
           }
       }


Please kindly help on this issue.

Thanks & Regards,
Amit  Nerkar





--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/How-to-know-whether-a-xlsx-cell-value-is-satisfying-the-conditional-formulae-criteria-tp5715853.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