Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFRow


    wb.createSheet("NoQuotesNeeded");
    wb.createSheet("Quotes Needed Here &#$@");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;

    cell = row.createCell((short)0);
    cell.setCellFormula("NoQuotesNeeded!A1");

    cell = row.createCell((short)1);
    cell.setCellFormula("'Quotes Needed Here &#$@'!A1");
  }
View Full Code Here


    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("Cash_Flow");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell;

    cell = row.createCell((short)0);
    cell.setCellFormula("Cash_Flow!A1");
  }
View Full Code Here

    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("Cash_Flow");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell((short)0);
    String formula = null;

    cell.setCellFormula("1.3E21/3");
    formula = cell.getCellFormula();
    assertEquals("Exponential formula string", "1.3E21/3", formula);
View Full Code Here

    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("Cash_Flow");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell((short)0);
    String formula = null;

    // starts from decimal point

    cell.setCellFormula(".1");
View Full Code Here

    HSSFWorkbook wb = new HSSFWorkbook();

    wb.createSheet("Cash_Flow");

    HSSFSheet sheet = wb.createSheet("Test");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell((short)0);
    String formula = null;

    cell.setCellFormula("A1.A2");
    formula = cell.getCellFormula();
    assertEquals("A1:A2", formula);
View Full Code Here

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet();
    wb.setSheetName(0, "Sheet1");

    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell((short)0);
    cell.setCellFormula("right(\"test\"\"ing\", 3)");
    String actualCellFormula = cell.getCellFormula();
    if("RIGHT(\"test\"ing\",3)".equals(actualCellFormula)) {
      throw new AssertionFailedError("Identified bug 28754b");
    }
View Full Code Here

    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet();
    wb.setSheetName(0, "Sheet1");

    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell((short)0);
    cell.setCellFormula("SUM(A32769:A32770)");
    if("SUM(A-32767:A-32766)".equals(cell.getCellFormula())) {
      fail("Identified bug 44539");
    }
    assertEquals("SUM(A32769:A32770)", cell.getCellFormula());
View Full Code Here

  }

  public void testInSpreadSheet() {
    HSSFWorkbook wb = new HSSFWorkbook();
    HSSFSheet sheet = wb.createSheet("Sheet1");
    HSSFRow row = sheet.createRow(0);
    HSSFCell cell = row.createCell((short)0);
    cell.setCellFormula("B1%");
    row.createCell((short)1).setCellValue(50.0);
   
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet, wb);
    fe.setCurrentRow(row);
    CellValue cv;
    try {
View Full Code Here

  public SVTableModel(HSSFSheet st) {
    this.st = st;
    Iterator i = st.rowIterator();

    while (i.hasNext()) {
      HSSFRow row = (HSSFRow)i.next();
      if (maxcol < (row.getLastCellNum()+1)) {
         this.maxcol = row.getLastCellNum();
      }
    }
  }
View Full Code Here

  public int getColumnCount() {
    return this.maxcol+1;
  }
  public Object getValueAt(int row, int col) {
    HSSFRow r = st.getRow(row);
    HSSFCell c = null;
    if (r != null) {
      c = r.getCell((short)col);
    }
    return c;
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.usermodel.HSSFRow

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.