Hi poi users,

I'm trying to set a background color in a cell with conditional formatting,
but the problem is that the color passed to setFillBackgroundColor method is
different from the background color cell that appears in the excel file.
Here is my code:

SheetConditionalFormatting sheetCF = sheet.getSheetConditionalFormatting();
ConditionalFormattingRule rule1 =
sheetCF.createConditionalFormattingRule(ComparisonOperator.GT, "0");

PatternFormatting fill1 = rule1.createPatternFormatting();
fill1.setFillBackgroundColor(IndexedColors.RED.index);
fill1.setFillPattern(PatternFormatting.SOLID_FOREGROUND);

ConditionalFormattingRule [] cfRules = { rule1 };
CellRangeAddress[] regions = { CellRangeAddress.valueOf("H4:J7") };
sheetCF.addConditionalFormatting(regions, cfRules);



--
View this message in context: 
http://apache-poi.1045710.n5.nabble.com/Set-background-color-in-a-conditional-formatting-cell-tp5716990.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