Examples of CellRangeAddressList


Examples of org.apache.poi.ss.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.ss.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

        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

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

    // read sec formula data condition
    _formula2 = Formula.read(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.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

    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

      List<XSSFDataValidation> xssfValidations = new ArrayList<XSSFDataValidation>();
      CTDataValidations dataValidations = this.worksheet.getDataValidations();
      if( dataValidations!=null && dataValidations.getCount() > 0 ) {
        CTDataValidation[] dataValidationList = dataValidations.getDataValidationArray();
        for (CTDataValidation ctDataValidation : dataValidationList) {
          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

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

        DataValidationHelper dataValidationHelper = sheet.getDataValidationHelper();
        DataValidationConstraint dvc = dataValidationHelper.createIntegerConstraint(DataValidationConstraint.OperatorType.BETWEEN, "10", "100");
        CellRangeAddressList numericCellAddressList = new CellRangeAddressList(0, 0, 1, 1);
        DataValidation dv = dataValidationHelper.createValidation(dvc,numericCellAddressList);
        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

Examples of org.apache.poi.ss.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.ss.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
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.