Hi .

I'd like to build an excel which contains 2 identical columns. The second one 
is hidden.
I wanted to add conditional formatting in order to change the format for every 
cell of the first column where the user changed the value.

Building the excel sheet is ok, but at the end, the format will change for the 
whole cells of the column only if we change the value of the first cell of the 
column.
It doesn't seems that the relative reference works well.

If I open the rule in Excel and just press save without changing anything in 
the rule, then it will start to work as expected.

My code is following :

        HSSFSheetConditionalFormatting scf = 
sheet.getSheetConditionalFormatting();
        HSSFConditionalFormattingRule rule= 
scf.createConditionalFormattingRule("B2<>C2");
        HSSFPatternFormatting patternFmt = rule.createPatternFormatting();
        patternFmt.setFillBackgroundColor(HSSFColor.BLUE_GREY.index);
        scf.addConditionalFormatting(new CellRangeAddress[] {new 
CellRangeAddress(1, 10, 1, 1)}, rule);

Any hints will be appreciated.

Cheers,
Patrick Brühlmann


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

Reply via email to