Package org.jfree.report.expressions

Examples of org.jfree.report.expressions.FormulaExpression


          function.setFormula(formula);
          this.expression = function;
        }
        else
        {
          final FormulaExpression expression = new FormulaExpression();
          expression.setFormula(formula);
          this.expression = expression;
        }
      }
      else
      {
        className = getDefaultClassName();
        if (className == null)
        {
          throw new ParseException("Required attribute 'class' is missing.",
              getRootHandler().getDocumentLocator());
        }
      }
    }

    if (expression == null)
    {
      expression = (Expression) ObjectUtilities.loadAndInstantiate
        (className, AbstractExpressionReadHandler.class, Expression.class);
      if (expression == null)
      {
        throw new ParseException("Expression '" + className +
            "' is not valid. The specified class is not an expression or function.",
             getRootHandler().getDocumentLocator());
      }
    }

    expression.setName(name);
    expression.setDeepTraversing("true".equals(attrs.getValue(getUri(), "deep-traversing")));
    expression.setPrecompute("true".equals(attrs.getValue(getUri(), "precompute")));
    expression.setPreserve("true".equals(attrs.getValue(getUri(), "preserve")));

    try
    {
      expressionBeanUtility = new BeanUtility(expression);
    }
View Full Code Here


      (final ReportTarget target)
      throws ReportProcessingException, ReportDataFactoryException,
      DataSourceException
  {
    final ImageElement imageElement = (ImageElement) getNode();
    final FormulaExpression formulaExpression = imageElement.getFormula();
    if (formulaExpression == null)
    {
      // A static image is easy. At least at this level. Dont ask about the weird things we have to do in the
      // output targets ...
      final String linkTarget = imageElement.getImageData();
View Full Code Here

  }

  protected boolean isValueChanged()
  {
    final ImageElement imageElement = (ImageElement) getNode();
    final FormulaExpression formulaExpression = imageElement.getFormula();
    if (formulaExpression == null)
    {
      final FlowController controller = getFlowController();
      final GlobalMasterRow masterRow = controller.getMasterRow();
      final ReportDataRow reportDataRow = masterRow.getReportDataRow();
      if (reportDataRow.getCursor() == 0)
      {
        return true;
      }
      return false;
    }

    try
    {
      final Formula formula = formulaExpression.getCompiledFormula();
      final LValue lValue = formula.getRootReference();
      return isReferenceChanged(lValue);
    }
    catch (ParseException e)
    {
View Full Code Here

    final AttributeMap variableSection = new AttributeMap();
    variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS);
    variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set");
    variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none");

    final FormulaExpression valueExpression = variable.getValueExpression();
    final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression);
    FormatValueUtility.applyValueForVariable(value, variableSection);
    variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + String.valueOf(value));
    return variableSection;
  }
View Full Code Here

    final String groupExpr = attrs.getValue
        (OfficeNamespaces.OOREPORT_NS, "group-expression");
    if (groupExpr != null)
    {
      final FormulaExpression function = new FormulaExpression();
      function.setFormula(groupExpr);
      groupInstanceSection.setGroupingExpression(function);
    }
  }
View Full Code Here

    String formula = attrs.getValue
        (OfficeNamespaces.OOREPORT_NS, "formula");
    if (formula != null)
    {
      final FormulaExpression valueExpression = new FormulaExpression();
      valueExpression.setFormula(formula);
      element.setValueExpression(valueExpression);
    }

    // * Print-Repeated-Values
    // * Print-In-First-New-Section
 
View Full Code Here

    if (stylename == null)
    {
      throw new ParseException
          ("Required attribute 'style-name' is missing.", getLocator());
    }
    final FormulaExpression valueExpression = new FormulaExpression();
    valueExpression.setFormula(formula);

    final FormatCondition formatCondition =
        new FormatCondition(valueExpression, stylename, enabled);
    element.addFormatCondition(formatCondition);
View Full Code Here

      function.setFormula(formula);
      this.expression = function;
    }
    else
    {
      final FormulaExpression expression = new FormulaExpression();
      expression.setFormula(formula);
      this.expression = expression;
    }

    expression.setName(name);
    expression.setDeepTraversing("true".equals(deepTraversing));
    expression.setPrecompute("true".equals(preEvaluated));
  }
View Full Code Here

        (OfficeNamespaces.OOREPORT_NS, "formula");
    if (formula != null && formula.length() != 0)
    {
      // now, the evaulated content ends up in the 'content' attribute of the
      // element.
      final FormulaExpression valueExpression = new FormulaExpression();
      valueExpression.setFormula(formula);
      contentElement.setFormula(valueExpression);
    }

    contentElement.setNamespace(OfficeNamespaces.FORM_NS);
    contentElement.setType("image");
View Full Code Here

  protected boolean isValueChanged()
  {
    try
    {
      final FormattedTextElement element = (FormattedTextElement) getNode();
      final FormulaExpression formulaExpression = element.getValueExpression();
      final Formula formula = formulaExpression.getCompiledFormula();
      final LValue lValue = formula.getRootReference();
      return isReferenceChanged(lValue);
    }
    catch (final ParseException e)
    {
View Full Code Here

TOP

Related Classes of org.jfree.report.expressions.FormulaExpression

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.