Examples of ReportFormulaContext


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

      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final String fieldName = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));

    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final ReportEnvironment reportEnvironment = rfc.getProcessingContext().getEnvironment();
    return new TypeValuePair(AnyType.TYPE, reportEnvironment.getEnvironmentProperty(fieldName));
  }
View Full Code Here

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

    else
    {
      type = String.class;
    }
   
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final DataAttributes data = rfc.getDataSchema().getAttributes(fieldName);
    if (data == null)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_INVALID_ARGUMENT_VALUE);
    }
    final DefaultDataAttributeContext attributeContext =
        new DefaultDataAttributeContext(rfc.getProcessingContext().getOutputProcessorMetaData(),
            rfc.getLocalizationContext().getLocale());
    final Object o = data.getMetaAttribute(metaNamespace, metaName, type, attributeContext);
    return new TypeValuePair(AnyType.TYPE, 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

    }
    if (context instanceof ReportFormulaContext == false)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
    }
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final DocumentMetaData data = rfc.getProcessingContext().getDocumentMetaData();

    if (parameterCount == 1)
    {
      final String metaName = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));
      final String[] namespaces = data.getMetaDataNamespaces();
View Full Code Here

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

        if (FORMULA_VALUE_ROLE.equals(valueRole) && isFormulaFragment())
        {
          final GenericExpressionRuntime expressionRuntime = new GenericExpressionRuntime
              (new StaticDataRow(), new DefaultTableModel(), -1, new DefaultProcessingContext());
          final String formulaText = FormulaUtil.createEditorTextFromFormula
              (String.valueOf(value), new ReportFormulaContext(new DefaultFormulaContext(), expressionRuntime));
          textField.setText(formulaText);
          comboBox.setSelectedItem(formulaText);
        }
        else
        {
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

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

      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_ARGUMENTS_VALUE);
    }

    final String fieldName = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));

    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final ReportEnvironment reportEnvironment = rfc.getProcessingContext().getEnvironment();
    return new TypeValuePair(AnyType.TYPE, reportEnvironment.getEnvironmentProperty(fieldName));
  }
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.