Examples of CellReference


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

   * @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

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

      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

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

            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

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

        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

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

     * @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

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

           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

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

    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

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

        return new XSSFComment(sheetComments, ctComment,
                vml == null ? null : vml.findCommentShape(row, column));
    }

    public XSSFHyperlink getHyperlink(int row, int column) {
        String ref = new CellReference(row, column).formatAsString();
        for(XSSFHyperlink hyperlink : hyperlinks) {
            if(hyperlink.getCellRef().equals(ref)) {
                return hyperlink;
            }
        }
View Full Code Here

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

        return _rows.size() == 0 ? 0 : _rows.lastKey();
    }

    public short getLeftCol() {
        String cellRef = worksheet.getSheetViews().getSheetViewArray(0).getTopLeftCell();
        CellReference cellReference = new CellReference(cellRef);
        return cellReference.getCol();
    }
View Full Code Here

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

     *
     * @return null if no pane configured, or the pane information.
     */
    public PaneInformation getPaneInformation() {
        CTPane pane = getPane();
        CellReference cellRef = pane.isSetTopLeftCell() ? new CellReference(pane.getTopLeftCell()) : null;
        return new PaneInformation((short)pane.getXSplit(), (short)pane.getYSplit(),
                (short)(cellRef == null ? 0 : cellRef.getRow()),(cellRef == null ? 0 : cellRef.getCol()),
                (byte)pane.getActivePane().intValue(), pane.getState() == STPaneState.FROZEN);
    }
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.