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

Examples of org.pentaho.reporting.engine.classic.core.Element


                                              final String group,
                                              final String fieldName)
  {
    if (aggregationType == null)
    {
      final Element footerValueElement = new Element();
      footerValueElement.setElementType(new LabelType());
      footerValueElement.setAttribute
          (AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, "");
      footerValueElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
          AttributeNames.Wizard.ALLOW_METADATA_STYLING, Boolean.TRUE);
      footerValueElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
          AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES, Boolean.FALSE);
      return footerValueElement;
    }

    final Element element = generateDetailsElement(fieldName, targetType);
    element.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.AGGREGATION_TYPE, aggregationType);
    element.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.AGGREGATION_GROUP, group);
    return element;
  }
View Full Code Here


    return element;
  }

  public static Element generateHeaderElement(final String fieldName)
  {
    final Element headerElement = new Element();
    headerElement.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, Boolean.TRUE);
    headerElement.setElementType(new LabelType());
    headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, fieldName);
    headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_STYLING, Boolean.TRUE);
    headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES, Boolean.TRUE);
    return headerElement;
  }
View Full Code Here

  }

  public static Element generateDetailsElement(final String fieldName,
                                               final ElementType targetType)
  {
    final Element detailsElement = new Element();
    detailsElement.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, Boolean.TRUE);
    detailsElement.setElementType(targetType);
    detailsElement.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, fieldName);
    detailsElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_STYLING, Boolean.TRUE);
    detailsElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
        AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES, Boolean.TRUE);
    return detailsElement;
  }
View Full Code Here

    final Element[] elementBuffer = b.unsafeGetElementArray();
    final int length = elementBuffer.length;
    for (int i = 0; i < length; i++)
    {
      final Element element = elementBuffer[i];
      if (element instanceof Band)
      {
        if (processBand((Band) element))
        {
          hasAttrExpressions = true;
View Full Code Here

      return band;
    }
    final Element[] elements = band.getElementArray();
    for (int i = 0; i < elements.length; i++)
    {
      final Element element = elements[i];
      if (element instanceof Band)
      {
        final Band retval = findGeneratedContentInternal((Band) element);
        if (retval != null)
        {
View Full Code Here

    if (getFormatKey() == null)
    {
      throw new IllegalStateException("ResourceKey is not set.");
    }

    final Element element = new Element();
    applyElementName(element);
    applyStyle(element.getStyle());
    element.setElementType(new ResourceMessageType());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.RESOURCE_IDENTIFIER, getResourceBase());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, getFormatKey());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.MESSAGE_NULL_VALUE, getMessageNullString());
    return element;
  }
View Full Code Here

   * @return the generated element.
   * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = super.createElement();
    element.setElementType(new ResourceFieldType());
    element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.RESOURCE_IDENTIFIER, getResourceBase());
    return element;
  }
View Full Code Here

   * @return the generated numberic text element
   * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();

    if (format instanceof DecimalFormat || format == null)
    {
      element.setElementType(new NumberFieldType());
      if (getFieldname() != null)
      {
        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 (format != null)
      {
        final DecimalFormat decimalFormat = (DecimalFormat) format;
        final String formatString = decimalFormat.toPattern();
        element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FORMAT_STRING, formatString);
      }
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    }
    else
    {
      final NumberFormatFilter dataSource = new NumberFormatFilter();
      if (format != null)
      {
        dataSource.setFormatter(format);
      }
      final DataRowDataSource dds = new DataRowDataSource();
      if (getFormula() != null)
      {
        dds.setFormula(getFormula());
      }
      else
      {
        dds.setDataSourceColumnName(getFieldname());
      }

      dataSource.setDataSource(dds);
      if (getNullString() != null)
      {
        dataSource.setNullValue(getNullString());
      }
      element.setDataSource(dataSource);
    }

    applyElementName(element);
    applyStyle(element.getStyle());
    element.getStyle().setStyleProperty(ElementStyleKeys.EXCEL_DATA_FORMAT_STRING, getExcelCellFormat());
    return element;
  }
View Full Code Here

   * @return the generated date text element
   * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement()
   */
  public Element createElement()
  {
    final Element element = new Element();
    if (format instanceof SimpleDateFormat ||
        format == null)
    {
      element.setElementType(new DateFieldType());
      if (getFieldname() != null)
      {
        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 (format != null)
      {
        final SimpleDateFormat simpleDateFormat = (SimpleDateFormat) format;
        final String formatString = simpleDateFormat.toPattern();
        element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FORMAT_STRING, formatString);
      }
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString());
    }
    else
    {
      element.setElementType(new LegacyType());
      final DateFormatFilter dataSource = new DateFormatFilter();
      if (format != null)
      {
        dataSource.setFormatter(format);
      }

      final DataRowDataSource dds = new DataRowDataSource();
      if (getFormula() != null)
      {
        dds.setFormula(getFormula());
      }
      else
      {
        dds.setDataSourceColumnName(getFieldname());
      }

      dataSource.setDataSource(dds);
      if (getNullString() != null)
      {
        dataSource.setNullValue(getNullString());
      }
      element.setDataSource(dataSource);
    }

    applyElementName(element);
    applyStyle(element.getStyle());
    element.getStyle().setStyleProperty(ElementStyleKeys.EXCEL_DATA_FORMAT_STRING, getExcelCellFormat());

    return element;
  }
View Full Code Here

    for (int i = 0; i < fieldDescriptions.length; i++)
    {
      final AutoGeneratorFieldDescription fieldDescription = fieldDescriptions[i];
      if (header != null)
      {
        final Element headerElement = AutoGeneratorUtility.generateHeaderElement(fieldDescription.getFieldName());
        final ElementStyleSheet headerStyle = headerElement.getStyle();
        headerStyle.setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(widths[i]));
        header.addElement(headerElement);
      }

      if (details != null)
      {
        final Element detailsElement = AutoGeneratorUtility.generateDetailsElement(fieldDescription.getFieldName(),
            fieldDescription.getTargetType());
        if (Boolean.TRUE.equals(fieldDescription.getHideDuplicateValues()))
        {
          detailsElement.setAttribute
              (AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ONLY_SHOW_CHANGING_VALUES, Boolean.TRUE);
        }

        final ElementStyleSheet detailsStyle = detailsElement.getStyle();
        detailsStyle.setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(widths[i]));
        details.addElement(detailsElement);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.Element

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.