Package org.apache.poi.ss.util

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


            try {
                mrow.removeCell(mcell);
                fail("expected exception");
            } catch (IllegalStateException e){
                CellReference ref = new CellReference(mcell);
                String msg = "Cell "+ref.formatAsString()+" is part of a multi-cell array formula. You cannot change part of an array.";
                assertEquals(msg, e.getMessage());
            }
            // a failed invocation of Row.removeCell leaves the row
            // in the state that it was in prior to the invocation
            assertSame(mcell, mrow.getCell(columnIndex));
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

  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

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

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

        evaluateCellValues();
        int columnCount = this.sheet.getRow(1-1).getLastCellNum();
        for (int row = firstRow; row <= lastRow; ++row) {
            for (int column = 0; column < columnCount; ++column) {
                CellReference cellRef = new CellReference(row-1, column);
                String cellAddress = cellRef.formatAsString();
                if (getCellFormula(cellAddress) == null) {
                    System.err.print("-");
                } else {
                    printCell(cellAddress);
                }
View Full Code Here

   void printFormulas(int firstRow, int lastRow) {
       int columnCount = this.sheet.getRow(1-1).getLastCellNum();
       for (int row = firstRow; row <= lastRow; ++row) {
           for (int column = 0; column < columnCount; ++column) {
               CellReference cellRef = new CellReference(row-1, column);
               String formula = getCellFormula(cellRef.formatAsString());
               if (formula == null) {
                   System.err.print("-");
               } else {
                   System.err.print(formula);
               }
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

                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

                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

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.