Examples of CellRangeAddressList


Examples of org.apache.poi.hssf.util.CellRangeAddressList

  private CellRangeAddressList field_4_cell_ranges;

  /** Creates new CFHeaderRecord */
  public CFHeaderRecord()
  {
    field_4_cell_ranges = new CellRangeAddressList();
  }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellRangeAddressList

  public CFHeaderRecord(RecordInputStream in)
  {
    field_1_numcf = in.readShort();
    field_2_need_recalculation = in.readShort();
    field_3_enclosing_cell_range = new CellRangeAddress(in);
    field_4_cell_ranges = new CellRangeAddressList(in);
  }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellRangeAddressList

  {
    if(cellRanges == null)
    {
      throw new IllegalArgumentException("cellRanges must not be null");
    }
    CellRangeAddressList cral = new CellRangeAddressList();
    CellRangeAddress enclosingRange = null;
    for (int i = 0; i < cellRanges.length; i++)
    {
      CellRangeAddress cr = cellRanges[i];
      enclosingRange = CellRangeUtil.createEnclosingCellRange(cr, enclosingRange);
      cral.addCellRangeAddress(cr);
    }
    field_3_enclosing_cell_range = enclosingRange;
    field_4_cell_ranges = cral;
  }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellRangeAddressList

     //read sec formula data condition
     _formula2 = Ptg.readTokens(field_size_sec_formula, in);

     //read cell range address list with all affected ranges
     _regions = new CellRangeAddressList(in);
  }
View Full Code Here

Examples of org.apache.poi.hssf.util.CellRangeAddressList

    // and then deleting the row that contains the cell.
    HSSFWorkbook wb = HSSFTestDataSamples.openSampleWorkbook("dvEmpty.xls")
    int dvRow = 0;
    HSSFSheet sheet = wb.getSheetAt(0);
    DVConstraint dc = DVConstraint.createNumericConstraint(VT.INTEGER, OP.EQUAL, "42", null);
    HSSFDataValidation dv = new HSSFDataValidation(new CellRangeAddressList(dvRow, dvRow, 0, 0), dc);
   
    dv.setEmptyCellAllowed(false);
    dv.setErrorStyle(ES.STOP);
    dv.setShowPromptBox(true);
    dv.createErrorBox("Xxx", "Yyy");
View Full Code Here

Examples of org.apache.poi.hssf.util.CellRangeAddressList

        String[] explicitListValues) {
      int rowNum = _currentRowIndex++;

      DVConstraint dc = createConstraint(operatorType, firstFormula, secondFormula, explicitListValues);

      HSSFDataValidation dv = new HSSFDataValidation(new CellRangeAddressList(rowNum, rowNum, 0, 0), dc);
     
      dv.setEmptyCellAllowed(allowEmpty);
      dv.setErrorStyle(errorStyle);
      dv.createErrorBox("Invalid Input", "Something is wrong - check condition!");
      dv.createPromptBox("Validated Cell", "Allowable values have been restricted");
View Full Code Here

Examples of org.apache.poi.ss.util.CellRangeAddressList

    public List<XSSFDataValidation> getDataValidations() {
      List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
      CTDataValidations dataValidations = this.worksheet.getDataValidations();
      if( dataValidations!=null && dataValidations.getCount() > 0 ) {
        for (CTDataValidation ctDataValidation : dataValidations.getDataValidationArray()) {
          CellRangeAddressList addressList = new CellRangeAddressList();
         
          @SuppressWarnings("unchecked")
          List<String> sqref = ctDataValidation.getSqref();
          for (String stRef : sqref) {
            String[] regions = stRef.split(" ");
            for (int i = 0; i < regions.length; i++) {
            String[] parts = regions[i].split(":");
            CellReference begin = new CellReference(parts[0]);
            CellReference end = parts.length > 1 ? new CellReference(parts[1]) : begin;
            CellRangeAddress cellRangeAddress = new CellRangeAddress(begin.getRow(), end.getRow(), begin.getCol(), end.getCol());
            addressList.addCellRangeAddress(cellRangeAddress);
          }
        }
        XSSFDataValidation xssfDataValidation = new XSSFDataValidation(addressList, ctDataValidation);
        xssfValidations.add(xssfDataValidation);
      }
View Full Code Here

Examples of org.apache.poi.ss.util.CellRangeAddressList

            int firstRow, int firstCol,
            int lastRow, int lastCol) {
        assert sheet != null;
        assert list != null;
        DataValidationHelper helper = sheet.getDataValidationHelper();
        CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
        DataValidationConstraint constraint = helper.createExplicitListConstraint(list);
        DataValidation validation = helper.createValidation(constraint, addressList);
        validation.setEmptyCellAllowed(true);
        sheet.addValidationData(validation);
    }
View Full Code Here

Examples of org.apache.poi.ss.util.CellRangeAddressList

            int firstRow,
            int lastRow,
            int firstCol,
            int lastCol) {
        //データの入力規則を設定するセルを設定する
        CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol);
        DVConstraint constraint = DVConstraint.createExplicitListConstraint(list);
        HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint);
        validation.setEmptyCellAllowed(true);
        validation.setSuppressDropDownArrow(false);
        sheet.addValidationData(validation);
View Full Code Here

Examples of org.apache.poi.ss.util.CellRangeAddressList

        HSSFSheet sheet = workbook.createSheet("Sheet1");
        sheet.protectSheet("secret");

        DVConstraint dvc = DVConstraint.createNumericConstraint(DVConstraint.ValidationType.INTEGER,
                                                DVConstraint.OperatorType.BETWEEN, "10", "100");
        CellRangeAddressList numericCellAddressList = new CellRangeAddressList(0, 0, 1, 1);
        HSSFDataValidation dv = new HSSFDataValidation(numericCellAddressList, dvc);
        try {
            sheet.addValidationData(dv);
        } catch (IllegalStateException e) {
            String expMsg = "Unexpected (org.apache.poi.hssf.record.PasswordRecord) while looking for DV Table insert pos";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.