Package org.apache.poi.ss.util

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


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


        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

                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

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

                CellReference ref = new CellReference(cell);

                //simulate correct answer
                String correct = "$A" + (rInd + 1) + "*" + columns[cInd] + "$2";

                assertEquals("Incorrect formula in " + ref.formatAsString(), correct, formula);
            }

        }
    }

View Full Code Here

        }
    }

    public void showInPane(short toprow, short leftcol) {
      CellReference cellReference = new CellReference(toprow, leftcol);
      String cellRef = cellReference.formatAsString();
      getSheetTypeSheetView().setTopLeftCell(cellRef);
    }

    public void ungroupColumn(short fromColumn, short toColumn) {
        // TODO Auto-generated method stub
View Full Code Here

 
  public static void getCellContents(Sheet sheet) {
      for (Row row : sheet) {
          for (Cell cell : row) {
            CellReference cellRef = new CellReference(row.getRowNum(), cell.getCellNum());
            System.out.print(cellRef.formatAsString());
            System.out.print(" - ");
           
            switch(cell.getCellType()) {
            case Cell.CELL_TYPE_STRING:
              System.out.println(cell.getRichStringCellValue().getString());
View Full Code Here

    public final String toString() {
        CellReference cr = new CellReference(getRow(), getColumn(), !isRowRelative(),!isColRelative());
        StringBuffer sb = new StringBuffer();
        sb.append(getClass().getName());
        sb.append(" [");
        sb.append(cr.formatAsString());
        sb.append("]");
        return sb.toString();
    }

    public final void writeBytes(byte [] array, int offset) {
View Full Code Here

        StringBuffer sb = new StringBuffer();
        sb.append(getClass().getName());
        sb.append(" [");
        sb.append("sheetIx=").append(getExternSheetIndex());
        sb.append(" ! ");
        sb.append(cr.formatAsString());
        sb.append("]");
        return sb.toString();
    }

    public void writeBytes(byte [] array, int offset) {
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.