Examples of CellValue


Examples of com.narirelays.ems.persistence.orm.CellValue

      {
        Calendar cal  = Calendar.getInstance();
        cal.clear();
        Date date = cal.getTime();
        CellValueId cellValueID = new CellValueId(id, new Timestamp(date.getTime()));
        CellValue cellValue = cellValueDAO.findById(cellValueID);
        if(cellValue!=null)
          result = cellValue.getValue();
      }
      else//day,month,year
      {
        if(reportType.equalsIgnoreCase("day"))
        {
          sdf = new SimpleDateFormat("yyyy-MM-dd")
        }
        else if(reportType.equalsIgnoreCase("month"))//月报,时间id为yyyy-MM-1
        {
          sdf = new SimpleDateFormat("yyyy-MM");
        }
        else if(reportType.equalsIgnoreCase("year"))//年报,时间id为yyyy-1-1
        {
          sdf = new SimpleDateFormat("yyyy");       
        }
        String timeString = sdf.format(time);
        try {
          Date date = sdf.parse(timeString);//得到格式化的时间id
          CellValueId cellValueID = new CellValueId(id, new Timestamp(date.getTime()));
          CellValue cellValue = cellValueDAO.findById(cellValueID);
          if(cellValue!=null)
            result = cellValue.getValue();
         
        } catch (ParseException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
View Full Code Here

Examples of jxl.write.biff.CellValue

    }
  }

  protected void addCell(int x, int y, JRPrintText text, String textStr, StyleInfo baseStyle) throws WriteException, RowsExceededException, JRException
  {
    CellValue cellValue = null;

    TextValue textValue = null;

    String textFormula = getFormula(text);
    if( textFormula != null)
View Full Code Here

Examples of jxl.write.biff.CellValue

    return cellFormat;
  }

  protected CellValue getAutoDetectedCellValue(int x, int y, String textStr, StyleInfo baseStyle) throws JRException
  {
    CellValue cellValue;
    try
    {
      double d = Double.parseDouble(textStr);
      WritableCellFormat cellStyle = getLoadedCellStyle(baseStyle);
      cellValue = new Number(x, y, d, cellStyle);
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

    cell.setCellFormula("B1%");
    row.createCell((short)1).setCellValue(50.0);
   
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet, wb);
    fe.setCurrentRow(row);
    CellValue cv;
    try {
      cv = fe.evaluate(cell);
    } catch (RuntimeException e) {
      if(e.getCause() instanceof NullPointerException) {
        throw new AssertionFailedError("Identified bug 44608");
      }
      // else some other unexpected error
      throw e;
    }
    assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
    assertEquals(0.5, cv.getNumberValue(), 0.0);
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

        
        cell.setCellFormula("isblank(Sheet2!A1:A1)");
       
        HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet1, wb);
        fe.setCurrentRow(row);
        CellValue result = fe.evaluate(cell);
        assertEquals(HSSFCell.CELL_TYPE_BOOLEAN, result.getCellType());
        assertEquals(true, result.getBooleanValue());
       
        cell.setCellFormula("isblank(D7:D7)");
       
        result = fe.evaluate(cell);
        assertEquals(HSSFCell.CELL_TYPE_BOOLEAN, result.getCellType());
        assertEquals(true, result.getBooleanValue());
       
   }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

      HSSFCell c = r.getCell(SS.COLUMN_INDEX_EVALUATION);
      if (c == null || c.getCellType() != HSSFCell.CELL_TYPE_FORMULA) {
        continue;
      }
      evaluator.setCurrentRow(r);
      CellValue actualValue = evaluator.evaluate(c);
      HSSFCell expectedValueCell = r.getCell(SS.COLUMN_INDEX_EXPECTED_RESULT);
      String rowComment = getRowCommentColumnValue(r);
     
      String msgPrefix = formatTestCaseDetails(sheetName, r.getRowNum(), c, currentGroupComment, rowComment);
      try {
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

          System.out.println("\t" + c.substring(c.lastIndexOf('.')+1) );
        }
        System.out.println("-> " + cell.getCellFormula());
      }
     
      CellValue evalResult = eval.evaluate(cell);
      assertNotNull(evalResult);
    }
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

        .getCellFormula());

    // We might as well evaluate the formula
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet, wb);
    fe.setCurrentRow(row);
    CellValue cv = fe.evaluate(cell);

    assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
    assertEquals(3.0, cv.getNumberValue(), 0.0);
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

    }
   
    // use POI's evaluator as an extra sanity check
    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet, wb);
    fe.setCurrentRow(row);
    CellValue cv;
    cv = fe.evaluate(cell);
    assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
    assertEquals(1.0, cv.getNumberValue(), 0.0);
   
    cv = fe.evaluate(row.getCell(1));
    assertEquals(HSSFCell.CELL_TYPE_BOOLEAN, cv.getCellType());
    assertEquals(true, cv.getBooleanValue());
  }
View Full Code Here

Examples of org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.CellValue

    double expectedResult = (4.0 * 8.0 + 5.0 * 9.0) / 10.0;

    HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(sheet1, wb);
    fe.setCurrentRow(row);
    CellValue cv = fe.evaluate(cell);

    assertEquals(HSSFCell.CELL_TYPE_NUMERIC, cv.getCellType());
    assertEquals(expectedResult, cv.getNumberValue(), 0.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.