<li><link href="#Validation">Data Validation</link></li>
<li><link href="#Embedded">Embedded Objects</link></li>
<li><link href="#Autofilter">Autofilters</link></li>
+ <li><link href="#ConditionalFormatting">Conditional Formatting</link></li>
</ul>
</section>
<section><title>Features</title>
sheet.setAutoFilter(CellRangeAddress.valueOf("C5:F200"));
</source>
</section>
+ <anchor id="ConditionalFormatting"/>
+ <section><title>Conditional Formatting (HSSF Only)</title>
+ <source>
+ HSSFWorkbook workbook = new HSSFWorkbook();
+ HSSFSheet sheet = workbook.createSheet();
+ String formula = "7";
+
+ HSSFSheetConditionalFormatting sheetCF = sheet.getSheetConditionalFormatting();
+
+ HSSFConditionalFormattingRule rule1 = sheetCF.createConditionalFormattingRule(formula);
+ HSSFFontFormatting fontFmt = rule1.createFontFormatting();
+ fontFmt.setFontStyle(true, false);
+
+ HSSFBorderFormatting bordFmt = rule1.createBorderFormatting();
+ bordFmt.setBorderBottom(HSSFBorderFormatting.BORDER_THIN);
+ bordFmt.setBorderTop(HSSFBorderFormatting.BORDER_THICK);
+ bordFmt.setBorderLeft(HSSFBorderFormatting.BORDER_DASHED);
+ bordFmt.setBorderRight(HSSFBorderFormatting.BORDER_DOTTED);
+
+ HSSFPatternFormatting patternFmt = rule1.createPatternFormatting();
+ patternFmt.setFillBackgroundColor(HSSFColor.YELLOW.index);
+
+ HSSFConditionalFormattingRule rule2 = sheetCF.createConditionalFormattingRule(ComparisonOperator.BETWEEN, "1", "2");
+ HSSFConditionalFormattingRule [] cfRules =
+ {
+ rule1, rule2
+ };
+
+ CellRangeAddress [] regions = {
+ new CellRangeAddress(2, 4, 0, 0), // A3:A5
+ };
+
+ sheetCF.addConditionalFormatting(regions, cfRules);
+ sheetCF.addConditionalFormatting(regions, cfRules);
+ </source>
+ </section>
</body>
</document>