Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.CFRuleRecord$ComparisonOperator


    {
      buffer.append(header.toString());
    }
    for(int i=0; i<rules.size(); i++)
    {
      CFRuleRecord cfRule = (CFRuleRecord)rules.get(i);
      buffer.append(cfRule.toString());
    }
    buffer.append("[/CF]\n");
    return buffer.toString();
  }
View Full Code Here


  }

  public void visitContainedRecords(RecordVisitor rv) {
    rv.visitRecord(header);
    for(int i=0; i<rules.size(); i++) {
      CFRuleRecord rule = (CFRuleRecord)rules.get(i);
      rv.visitRecord(rule);
    }
  }
View Full Code Here

      temp.toArray(newRanges);
      header.setCellRanges(newRanges);
    }
   
    for(int i=0; i<rules.size(); i++) {
      CFRuleRecord rule = (CFRuleRecord)rules.get(i);
      Ptg[] ptgs;
      ptgs = rule.getParsedExpression1();
      if (ptgs != null && shifter.adjustFormula(ptgs, currentExternSheetIx)) {
        rule.setParsedExpression1(ptgs);
      }
      ptgs = rule.getParsedExpression2();
      if (ptgs != null && shifter.adjustFormula(ptgs, currentExternSheetIx)) {
        rule.setParsedExpression2(ptgs);
      }
    }
    return true;
  }
View Full Code Here

      byte comparisonOperation,
      String formula1,
      String formula2) {

    HSSFWorkbook wb = _workbook;
    CFRuleRecord rr = CFRuleRecord.create(wb, comparisonOperation, formula1, formula2);
    return new HSSFConditionalFormattingRule(wb, rr);
  }
View Full Code Here

   * TODO - formulas containing cell references are currently not parsed properly
   * @param formula - formula for the valued, compared with the cell
   */
  public HSSFConditionalFormattingRule createConditionalFormattingRule(String formula) {
    HSSFWorkbook wb = _workbook;
    CFRuleRecord rr = CFRuleRecord.create(wb, formula);
    return new HSSFConditionalFormattingRule(wb, rr);
  }
View Full Code Here

  /**
   * @return the Conditional Formatting rule at position idx.
   */
  public HSSFConditionalFormattingRule getRule(int idx)
  {
    CFRuleRecord ruleRecord = cfAggregate.getRule(idx);
    return new HSSFConditionalFormattingRule(_workbook, ruleRecord);
  }
View Full Code Here

  public void testCFRecordsAggregate()
  {
    HSSFWorkbook workbook = new HSSFWorkbook();
    List recs = new ArrayList();
    CFHeaderRecord header = new CFHeaderRecord();
    CFRuleRecord rule1 = CFRuleRecord.create(workbook, "7");
    CFRuleRecord rule2 = CFRuleRecord.create(workbook, ComparisonOperator.BETWEEN, "2", "5");
    CFRuleRecord rule3 = CFRuleRecord.create(workbook, ComparisonOperator.GE, "100", null);
    header.setNumberOfConditionalFormats(3);
    CellRangeAddress[] cellRanges = {
        new CellRangeAddress(0,1,0,0),
        new CellRangeAddress(0,1,2,2),
    };
View Full Code Here

    HSSFWorkbook workbook = new HSSFWorkbook();
        HSSFSheet sheet = workbook.createSheet();

        List recs = new ArrayList();
    CFHeaderRecord header = new CFHeaderRecord();
    CFRuleRecord rule1 = CFRuleRecord.create(sheet, "7");
    CFRuleRecord rule2 = CFRuleRecord.create(sheet, ComparisonOperator.BETWEEN, "2", "5");
    CFRuleRecord rule3 = CFRuleRecord.create(sheet, ComparisonOperator.GE, "100", null);
    header.setNumberOfConditionalFormats(3);
    CellRangeAddress[] cellRanges = {
        new CellRangeAddress(0,1,0,0),
        new CellRangeAddress(0,1,2,2),
    };
View Full Code Here

      byte comparisonOperation,
      String formula1,
      String formula2) {

    HSSFWorkbook wb = _sheet.getWorkbook();
    CFRuleRecord rr = CFRuleRecord.create(_sheet, comparisonOperation, formula1, formula2);
    return new HSSFConditionalFormattingRule(wb, rr);
  }
View Full Code Here

    public HSSFConditionalFormattingRule createConditionalFormattingRule(
            byte comparisonOperation,
            String formula1) {

        HSSFWorkbook wb = _sheet.getWorkbook();
        CFRuleRecord rr = CFRuleRecord.create(_sheet, comparisonOperation, formula1, null);
        return new HSSFConditionalFormattingRule(wb, rr);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.CFRuleRecord$ComparisonOperator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.