Package org.zkoss.poi.xssf.usermodel

Examples of org.zkoss.poi.xssf.usermodel.XSSFName


    }
  }

  @Override
  public CellRangeAddress getRepeatingRowsAndColumns(int sheetNumber) {
    final XSSFName name = getBuiltInName(XSSFName.BUILTIN_PRINT_TITLE, sheetNumber);
    if (name == null) {
      return new CellRangeAddress(-1, -1, -1, -1);
    } else {
      final String formula = name.getRefersToFormula();
      final Ptg[] ptgs = FormulaParser.parse(formula, XSSFEvaluationWorkbook.create(this), FormulaType.NAMEDRANGE, name.getSheetIndex());
      return BookHelper.getRepeatRowsAndColumns(ptgs);
    }
  }
View Full Code Here


    }
  }
    public XSSFName getBuiltInName(String builtInCode, int sheetNumber) {
      final int sz  = getNumberOfNames();
      for (int j = 0; j < sz; ++j) {
        XSSFName name = getNameAt(j);
            if (name.getNameName().equalsIgnoreCase(builtInCode) && name.getSheetIndex() == sheetNumber) {
                return name;
            }
        }
        return null;
    }
View Full Code Here

    }
   
    private void updateNamedRanges(XSSFWorkbook wb, PtgShifter shifter) {
        XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb);
        for (int i = 0; i < wb.getNumberOfNames(); i++) {
            XSSFName name = wb.getNameAt(i);
            String formula = name.getRefersToFormula();
            int sheetIndex = name.getSheetIndex();

            // 20120904 samchuang@zkoss.org: ZSS-153, user define formula name range doesn't need to adjust range
            if (formula != null) {
                Ptg[] ptgs = FormulaParser.parse(formula, fpb, FormulaType.NAMEDRANGE, sheetIndex);
                if (shifter.adjustFormula(ptgs, sheetIndex)) {
                    String shiftedFmla = FormulaRenderer.toFormulaString(fpb, ptgs);
                    name.setRefersToFormula(shiftedFmla);
               
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.xssf.usermodel.XSSFName

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.