Package org.apache.poi.hssf.usermodel

Examples of org.apache.poi.hssf.usermodel.HSSFRow.createCell()


    HSSFCell cell;

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

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

  public void testUnaryMinus() {
    Ptg[] ptgs = parseFormula("-A1");
View Full Code Here


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

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

  // bug 38396 : Formula with exponential numbers not parsed correctly.
  public void testExponentialParsing() {
View Full Code Here

    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

    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

    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);
View Full Code Here

    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

                        HSSFCell cell = row.getCell(colnum);

                        if (cell == null) {
                            //getLogger().debug("creating blank cell at "+rownum + "," +colnum);
                            cell = row.createCell(colnum,HSSFCell.CELL_TYPE_BLANK);
                            cell.setCellStyle((HSSFCellStyle)regions.get(region));
                        }
                    }

                }
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.