Package org.apache.poi.ss.util

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


    if(anchorName != null)
    {
      HSSFName aName = workbook.createName();
//      aName.setNameName(JRStringUtil.getJavaIdentifier(anchorName));
      aName.setSheetIndex(workbook.getSheetIndex(sheet));
      CellReference cRef = new CellReference(rowIndex, colIndex);
      aName.setRefersToFormula(cRef.formatAsString());
      anchorNames.put(anchorName, aName);
    }

    setHyperlinkCell(textElement);
  }
View Full Code Here


   */
  private NotImplementedException addExceptionInfo(NotImplementedException inner, int sheetIndex, int rowIndex, int columnIndex) {

    try {
      String sheetName = _workbook.getSheetName(sheetIndex);
      CellReference cr = new CellReference(sheetName, rowIndex, columnIndex, false, false);
      String msg =  "Error evaluating cell " + cr.formatAsString();
      return new NotImplementedException(msg, inner);
    } catch (Exception e) {
      // avoid bombing out during exception handling
      e.printStackTrace();
      return inner; // preserve original exception
View Full Code Here

      }
      return cce.getValue();
    }
    if (isDebugLogEnabled()) {
      String sheetName = getSheetName(sheetIndex);
      CellReference cr = new CellReference(rowIndex, columnIndex);
      logDebug("Evaluated " + sheetName + "!" + cr.formatAsString() + " to " + result.toString());
    }
    // Usually (result === cce.getValue())
    // But sometimes: (result==ErrorEval.CIRCULAR_REF_ERROR, cce.getValue()==null)
    // When circular references are detected, the cache entry is only updated for
    // the top evaluation frame
View Full Code Here

   * @return the SHRFMLA, TABLE or ARRAY record for the formula cell, if it is the first cell of
   * a table or array region. <code>null</code> if the formula cell is not shared/array/table,
   * or if the specified formula is not the the first in the group.
   */
  public SharedValueRecordBase getRecordForFirstCell(FormulaRecordAggregate agg) {
    CellReference firstCell = agg.getFormulaRecord().getFormula().getExpReference();
    // perhaps this could be optimised by consulting the (somewhat unreliable) isShared flag
    // and/or distinguishing between tExp and tTbl.
    if (firstCell == null) {
      // not a shared/array/table formula
      return null;
    }


    int row = firstCell.getRow();
    int column = firstCell.getCol();
    if (agg.getRow() != row || agg.getColumn() != column) {
      // not the first formula cell in the group
      return null;
    }

View Full Code Here

      if (ar.isInRange(rowIndex, columnIndex)) {
        _arrayRecords.remove(ar);
        return ar.getRange();
      }
    }
    String ref = new CellReference(rowIndex, columnIndex, false, false).formatAsString();
    throw new IllegalArgumentException("Specified cell " + ref
        + " is not part of an array formula.");
  }
View Full Code Here

            if(cell==null)
            {
                _rowContainedNullCells=true;
                return;
            }
            String ref = new CellReference(_rownum, columnIndex).formatAsString();
            _out.write("<c r=\""+ref+"\"");
            CellStyle cellStyle=cell.getCellStyle();
            if(cellStyle.getIndex() != 0) _out.write(" s=\""+cellStyle.getIndex()+"\"");
            int cellType=cell.getCellType();
            switch(cellType)
View Full Code Here

        agg.setParsedExpression(ptgsForCell);
    }

    public CellRangeAddress getArrayFormulaRange() {
        if (_cellType != CELL_TYPE_FORMULA) {
            String ref = new CellReference(this).formatAsString();
            throw new IllegalStateException("Cell " + ref
                    + " is not part of an array formula.");
        }
        return ((FormulaRecordAggregate)_record).getArrayFormulaRange();
    }
View Full Code Here

     * @see org.apache.poi.hssf.usermodel.HSSFSheet#shiftRows(int, int, int)
     * @see org.apache.poi.hssf.usermodel.HSSFSheet#addMergedRegion(org.apache.poi.ss.util.CellRangeAddress)
     * @throws IllegalStateException if modification is not allowed
     */
    void notifyArrayFormulaChanging(){
        CellReference ref = new CellReference(this);
        String msg = "Cell "+ref.formatAsString()+" is part of a multi-cell array formula. " +
                "You cannot change part of an array.";
        notifyArrayFormulaChanging(msg);
    }
View Full Code Here

           pane.unsetYSplit();
        }
       
        pane.setState(STPaneState.FROZEN);
        if (rowSplit == 0) {
            pane.setTopLeftCell(new CellReference(0, leftmostColumn).formatAsString());
            pane.setActivePane(STPane.TOP_RIGHT);
        } else if (colSplit == 0) {
            pane.setTopLeftCell(new CellReference(topRow, 0).formatAsString());
            pane.setActivePane(STPane.BOTTOM_LEFT);
        } else {
            pane.setTopLeftCell(new CellReference(topRow, leftmostColumn).formatAsString());
            pane.setActivePane(STPane.BOTTOM_RIGHT);
        }

        CTSheetView ctView = getDefaultSheetView();
        ctView.setSelectionArray(null);
View Full Code Here

    public XSSFComment getCellComment(int row, int column) {
        if (sheetComments == null) {
            return null;
        }

        String ref = new CellReference(row, column).formatAsString();
        CTComment ctComment = sheetComments.getCTComment(ref);
        if(ctComment == null) return null;

        XSSFVMLDrawing vml = getVMLDrawing(false);
        return new XSSFComment(sheetComments, ctComment,
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.util.CellReference

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.