Package org.pentaho.reporting.libraries.formula

Examples of org.pentaho.reporting.libraries.formula.FormulaContext


  }


  public void testDateConversion1899 ()
  {
    final FormulaContext context = getContext();
    final Date januaryFirst1904 = DateUtil.createDate(1904, 1, 1, context.getLocalizationContext());
    final Date januaryFirst1900 = DateUtil.createDate(1900, 1, 1, context.getLocalizationContext());
    final Date marchFirst1904 = DateUtil.createDate(1904, 3, 1, context.getLocalizationContext());
    final Date marchFirst1900 = DateUtil.createDate(1900, 3, 1, context.getLocalizationContext());

    // these numbers must match whatever OpenOffice computes ..
    assertEqual(HSSFDateUtil.getExcelDate(januaryFirst1900, false, HSSFDateUtil.computeZeroDate("1899", false)), new BigDecimal(2));
    assertEqual(HSSFDateUtil.getExcelDate(marchFirst1900, false, HSSFDateUtil.computeZeroDate("1899", false)), new BigDecimal(61));
    assertEqual(HSSFDateUtil.getExcelDate(januaryFirst1904, false, HSSFDateUtil.computeZeroDate("1899", false)), new BigDecimal(1462));
View Full Code Here


  }

  public TypeValuePair evaluate() throws EvaluationException
  {
    // First, grab the parameters and their types.
    final FormulaContext context = getContext();
    // And if everything is ok, compute the stuff ..
    if (function == null)
    {
      throw new EvaluationException(LibFormulaErrorValue.ERROR_INVALID_FUNCTION_VALUE);
    }
View Full Code Here

    setParsePosition(parsePosition);
  }

  public TypeValuePair evaluate() throws EvaluationException
  {
    final FormulaContext context = getContext();
    final Object value = context.resolveReference(name);
    final Type type = context.resolveReferenceType(name);
    return new TypeValuePair(type, value);
  }
View Full Code Here

  public Type getValueType()
  {
    try
    {
      final FormulaContext context = getContext();
      return context.resolveReferenceType(name);
    }
    catch (final EvaluationException evalex)
    {
      // exception ignored.
      return ErrorType.TYPE;
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.formula.FormulaContext

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.