Examples of ReportFormulaContext


Examples of org.jfree.report.expressions.ReportFormulaContext

    {
      return new TypeValuePair(ErrorType.TYPE, new LibFormulaErrorValue
          (LibFormulaErrorValue.ERROR_REFERENCE_NOT_RESOLVABLE));
    }

    final ReportFormulaContext reportFormulaContext =
        (ReportFormulaContext) context;
    Object declaringElement = reportFormulaContext.getDeclaringElement();
    if (declaringElement instanceof Element == false)
    {
      return new TypeValuePair(ErrorType.TYPE, new LibFormulaErrorValue
          (LibFormulaErrorValue.ERROR_REFERENCE_NOT_RESOLVABLE));
    }
View Full Code Here

Examples of org.jfree.report.expressions.ReportFormulaContext

    {
      return new TypeValuePair(ErrorType.TYPE, new LibFormulaErrorValue
          (LibFormulaErrorValue.ERROR_REFERENCE_NOT_RESOLVABLE));
    }

    final ReportFormulaContext reportFormulaContext =
        (ReportFormulaContext) context;
    final Object declaringElement = reportFormulaContext.getDeclaringElement();
    if (declaringElement instanceof Element == false)
    {
      return new TypeValuePair(ErrorType.TYPE, new LibFormulaErrorValue
          (LibFormulaErrorValue.ERROR_REFERENCE_NOT_RESOLVABLE));
    }
View Full Code Here

Examples of org.jfree.report.expressions.ReportFormulaContext

    {
      return new TypeValuePair(ErrorType.TYPE, new LibFormulaErrorValue
          (LibFormulaErrorValue.ERROR_REFERENCE_NOT_RESOLVABLE));
    }

    final ReportFormulaContext reportFormulaContext =
        (ReportFormulaContext) context;
    Object declaringElement = reportFormulaContext.getDeclaringElement();
    if (declaringElement instanceof Element == false)
    {
      return new TypeValuePair(ErrorType.TYPE, new LibFormulaErrorValue
          (LibFormulaErrorValue.ERROR_REFERENCE_NOT_RESOLVABLE));
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

                  computeMantleTabName(formulaContext, entries), computeMantleTabActive(formulaContext, entries)});

      final ExpressionRuntime expressionRuntime;
      if (formulaContext instanceof ReportFormulaContext)
      {
        final ReportFormulaContext rfc = (ReportFormulaContext) formulaContext;
        expressionRuntime = new WrapperExpressionRuntime(staticDataRow, rfc.getRuntime());
      }
      else
      {
        expressionRuntime = new GenericExpressionRuntime
            (new CompoundDataRow(staticDataRow, createDataRow(entries)),
                new DefaultTableModel(), -1, new DefaultProcessingContext());
      }


      final String formula = computeFormula(configIndicator);
      final Formula compiledFormula = new Formula(formula);
      compiledFormula.initialize(new ReportFormulaContext(formulaContext, expressionRuntime));
      final Object o = compiledFormula.evaluate();
      if (o instanceof ErrorValue)
      {
        throw EvaluationException.getInstance((ErrorValue) o);
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

    if (parameters.getParameterCount() > 1)
    {
      tabText = typeRegistry.convertToText(parameters.getType(1), parameters.getValue(1));
    }

    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    if (StringUtils.isEmpty(tabText))
    {
      final DocumentMetaData documentMetaData = rfc.getProcessingContext().getDocumentMetaData();
      tabText = (String) documentMetaData.getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
      if (StringUtils.isEmpty(tabText))
      {
        final Object o = rfc.getDataRow().get("report.name");
        if (o != null)
        {
          tabText = String.valueOf(o);
        }
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

    if (context instanceof ReportFormulaContext == false)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_FUNCTION_VALUE);
    }

    final ReportFormulaContext rfc = (ReportFormulaContext) context;

    final int parameterCount = parameters.getParameterCount();
    if (parameterCount < 1)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

    final int parameterCount = parameters.getParameterCount();
    if (parameterCount > 1)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final int groupStart;
    if (parameterCount == 0)
    {
      groupStart = rfc.getRuntime().getGroupStartRow(-1);
    }
    else
    {
      final String groupName = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));
      groupStart = rfc.getRuntime().getGroupStartRow(groupName);
    }
    final int row = rfc.getRuntime().getCurrentRow();
    //noinspection UnpredictableBigDecimalConstructorCall
    return new TypeValuePair(NumberType.GENERIC_NUMBER, new BigDecimal((double) (row - groupStart)));
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

  }

  public TypeValuePair evaluate(final FormulaContext context,
                                final ParameterCallback parameters) throws EvaluationException
  {
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final boolean value = rfc.isResultSetEmpty();

    if (value)
    {
      return new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
    }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

  }

  public TypeValuePair evaluate(final FormulaContext context,
                                final ParameterCallback parameters) throws EvaluationException
  {
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    if (isDashboardMode(rfc))
    {
      return new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
    }
    return new TypeValuePair(LogicalType.TYPE, Boolean.FALSE);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.ReportFormulaContext

    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final Object value = parameters.getValue(0);
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    if (value != null && rfc.getExportType().startsWith(String.valueOf(value)))
    {
      return new TypeValuePair(LogicalType.TYPE, Boolean.TRUE);
    }

    return new TypeValuePair(LogicalType.TYPE, Boolean.FALSE);
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.