Search in sources :

Example 1 with CFHeader12Record

use of org.apache.poi.hssf.record.CFHeader12Record in project poi by apache.

the class CFRecordsAggregate method toString.

/**
     * String representation of CFRecordsAggregate
     */
public String toString() {
    StringBuilder buffer = new StringBuilder();
    String type = "CF";
    if (header instanceof CFHeader12Record) {
        type = "CF12";
    }
    buffer.append("[").append(type).append("]\n");
    if (header != null) {
        buffer.append(header);
    }
    for (CFRuleBase cfRule : rules) {
        buffer.append(cfRule);
    }
    buffer.append("[/").append(type).append("]\n");
    return buffer.toString();
}
Also used : CFHeader12Record(org.apache.poi.hssf.record.CFHeader12Record) CFRuleBase(org.apache.poi.hssf.record.CFRuleBase)

Example 2 with CFHeader12Record

use of org.apache.poi.hssf.record.CFHeader12Record in project poi by apache.

the class CFRecordsAggregate method createHeader.

private static CFHeaderBase createHeader(CellRangeAddress[] regions, CFRuleBase[] rules) {
    final CFHeaderBase header;
    if (rules.length == 0 || rules[0] instanceof CFRuleRecord) {
        header = new CFHeaderRecord(regions, rules.length);
    } else {
        header = new CFHeader12Record(regions, rules.length);
    }
    // set the "needs recalculate" by default to avoid Excel handling conditional formatting incorrectly
    // see bug 52122 for details
    header.setNeedRecalculation(true);
    return header;
}
Also used : CFHeader12Record(org.apache.poi.hssf.record.CFHeader12Record) CFRuleRecord(org.apache.poi.hssf.record.CFRuleRecord) CFHeaderRecord(org.apache.poi.hssf.record.CFHeaderRecord) CFHeaderBase(org.apache.poi.hssf.record.CFHeaderBase)

Aggregations

CFHeader12Record (org.apache.poi.hssf.record.CFHeader12Record)2 CFHeaderBase (org.apache.poi.hssf.record.CFHeaderBase)1 CFHeaderRecord (org.apache.poi.hssf.record.CFHeaderRecord)1 CFRuleBase (org.apache.poi.hssf.record.CFRuleBase)1 CFRuleRecord (org.apache.poi.hssf.record.CFRuleRecord)1