Package org.pentaho.reporting.engine.classic.core.function

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


    }

    String s = propertyReadHandler.getResult();
    if (StringUtils.isEmpty(s, true) == false)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      if (s.startsWith("report:"))
      {
        s = "=" + s.substring("report:".length()).trim();
      }
      else
      {
        s = s.trim();
      }
      if (s.endsWith(";"))
      {
        s = s.substring(0, s.length() - 1);
      }
      formulaExpression.setFormula(s);
      return formulaExpression;
    }
    return null;
  }
View Full Code Here


  public IndexDataGeneratorFunction()
  {
    this.pageFunction = new PageFunction();
    this.indexSeparator = ".";
    this.model = new TypedTableModel();
    this.dataFormula = new FormulaExpression();
    this.dataStorage = new TreeMap();
  }
View Full Code Here

    super.doneParsing();
    expressions = new HashMap();
    for (int i = 0; i < styleExpressions.size(); i++)
    {
      final ElementStyleExpressionReadHandler handler = (ElementStyleExpressionReadHandler) styleExpressions.get(i);
      final FormulaExpression expression = new FormulaExpression();
      expression.setFormula(ReportDesignerParserUtil.normalizeFormula(handler.getFormula()));
      expressions.put(handler.getStyleKey(), expression);
    }
  }
View Full Code Here

   */
  protected void doneParsing() throws SAXException
  {
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression formulaExpression = (FormulaExpression) expression;
      formulaExpression.setFormula(ReportDesignerParserUtil.normalizeFormula(formulaExpression.getFormula()));
    }
    else if (expression instanceof FormulaFunction)
    {
      final FormulaFunction formulaFunction = (FormulaFunction) expression;
      formulaFunction.setFormula(ReportDesignerParserUtil.normalizeFormula(formulaFunction.getFormula()));
View Full Code Here

    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
    }
    if (getFormula() != null)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(getFormula());
      element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
    }

    if (getType() != null)
    {
View Full Code Here

      throws IOException
  {
    final XmlWriter writer = getXmlWriter();
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression fe = (FormulaExpression) expression;
      final AttributeList properties = new AttributeList();
      if (expression.getName() != null)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
      }
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
      writer.writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.EXPRESSION_TAG, properties, XmlWriterSupport.CLOSE);
      return;
    }

    if (expression instanceof FormulaFunction)
    {
      final FormulaFunction fe = (FormulaFunction) expression;
      final AttributeList properties = new AttributeList();
      if (expression.getName() != null)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
      }
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      properties.setAttribute(ExtParserModule.NAMESPACE, "initial", fe.getInitial());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
View Full Code Here

                                   final StyleKey styleKey)
      throws IOException
  {
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression fe = (FormulaExpression) expression;
      final AttributeList properties = new AttributeList();
      properties.setAttribute(ExtParserModule.NAMESPACE, "style-key", styleKey.getName());
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
      getXmlWriter().writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.STYLE_EXPRESSION_TAG, properties,
          XmlWriterSupport.CLOSE);
      return;
    }

    if (expression instanceof FormulaFunction)
    {
      final FormulaFunction fe = (FormulaFunction) expression;
      final AttributeList properties = new AttributeList();
      properties.setAttribute(ExtParserModule.NAMESPACE, "style-key", styleKey.getName());
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      properties.setAttribute(ExtParserModule.NAMESPACE, "initial", fe.getInitial());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
View Full Code Here

  {
    this.groups = new ArrayList();
    this.pageFunction = new PageFunction();
    this.indexSeparator = ".";
    this.model = new TypedTableModel();
    this.titleFormula = new FormulaExpression();
    this.dependencyLevel = LayoutProcess.LEVEL_COLLECT;
  }
View Full Code Here

  public FormulaPieTooltipGenerator(final ExpressionRuntime runtime,
                                    final String formula)
  {
    this.runtime = runtime;
    this.formulaExpression = new FormulaExpression();
    this.formulaExpression.setFormula(formula);
  }
View Full Code Here

  public FormulaCategoryTooltipGenerator(final ExpressionRuntime runtime,
                                         final String formula)
  {
    this.runtime = runtime;
    this.formulaExpression = new FormulaExpression();
    this.formulaExpression.setFormula(formula);
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.function.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.