Package org.apache.poi.ss.util

Examples of org.apache.poi.ss.util.CellReference.formatAsString()


  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


    CellReference botRight = new CellReference(getLastRow(),getLastColumn(),!isLastRowRelative(),!isLastColRelative());

    if(AreaReference.isWholeColumnReference(topLeft, botRight)) {
      return (new AreaReference(topLeft, botRight)).formatAsString();
    }
    return topLeft.formatAsString() + ":" + botRight.formatAsString();
  }

  public String toFormulaString() {
    return formatReferenceAsString();
  }
View Full Code Here

        if (name == null) {
            name = wb.createBuiltInName(XSSFName.BUILTIN_FILTER_DB, sheetIndex);
            name.getCTName().setHidden(true);
            CellReference r1 = new CellReference(getSheetName(), range.getFirstRow(), range.getFirstColumn(), true, true);
            CellReference r2 = new CellReference(null, range.getLastRow(), range.getLastColumn(), true, true);
            String fmla = r1.formatAsString() + ":" + r2.formatAsString();
            name.setRefersToFormula(fmla);
        }

        return new XSSFAutoFilter(this);
    }
View Full Code Here

        }

        name.getCTName().setHidden(true);
        CellReference r1 = new CellReference(getSheetName(), range.getFirstRow(), range.getFirstColumn(), true, true);
        CellReference r2 = new CellReference(null, range.getLastRow(), range.getLastColumn(), true, true);
        String fmla = r1.formatAsString() + ":" + r2.formatAsString();
        name.setRefersToFormula(fmla);

        return new XSSFAutoFilter(this);
    }
View Full Code Here

    CellReference cr = new CellReference(getRow(), getColumn());
    StringBuffer sb = new StringBuffer();
    sb.append(getClass().getName()).append("[");
    sb.append(_evaluator.getSheetNameRange());
    sb.append('!');
    sb.append(cr.formatAsString());
    sb.append("]");
    return sb.toString();
  }
}
View Full Code Here

                for (CTComment comment : lst.getCommentArray()) {
                    String oldRef = comment.getRef();
                    CellReference ref = new CellReference(oldRef);
                    if(ref.getRow() == rownum){
                        ref = new CellReference(rownum + n, ref.getCol());
                        comment.setRef(ref.formatAsString());
                        sheetComments.referenceUpdated(oldRef, comment);
                    }
                }
            }
View Full Code Here

     * @param leftcol the left column to show in desktop window pane
     */
    @Override
    public void showInPane(int toprow, int leftcol) {
        CellReference cellReference = new CellReference(toprow, leftcol);
        String cellRef = cellReference.formatAsString();
        getPane().setTopLeftCell(cellRef);
    }

    /**
     * Location of the top left visible cell Location of the top left visible cell in the bottom right
View Full Code Here

     * @see org.apache.poi.xssf.usermodel.XSSFSheet#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

                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (CTComment comment : lst.getCommentArray()) {
                    CellReference ref = new CellReference(comment.getRef());
                    if(ref.getRow() == rownum){
                        ref = new CellReference(rownum + n, ref.getCol());
                        comment.setRef(ref.formatAsString());
                    }
                }
            }
        }
        XSSFRowShifter rowShifter = new XSSFRowShifter(this);
View Full Code Here

     * @param toprow the top row to show in desktop window pane
     * @param leftcol the left column to show in desktop window pane
     */
    public void showInPane(short toprow, short leftcol) {
        CellReference cellReference = new CellReference(toprow, leftcol);
        String cellRef = cellReference.formatAsString();
        getPane().setTopLeftCell(cellRef);
    }

    public void ungroupColumn(int fromColumn, int toColumn) {
        CTCols cols = worksheet.getColsArray(0);
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.