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

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


      if (repeat != null)
      {
        header.setRepeat(repeat.booleanValue());
      }

      final Band content = AutoGeneratorUtility.findGeneratedContent(header);
      if (content == null)
      {
        return;
      }

      final Element headerLabelElement = new Element();
      headerLabelElement.setElementType(new LabelType());
      if (groupDefinition.getDisplayName() != null)
      {
        headerLabelElement.setAttribute
            (AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, groupDefinition.getDisplayName());
      }
      else
      {
        headerLabelElement.setAttribute
            (AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, groupDefinition.getField());
        headerLabelElement.setAttribute
            (AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, groupDefinition.getField());
        headerLabelElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
          AttributeNames.Wizard.ALLOW_METADATA_ATTRIBUTES, Boolean.TRUE);
      }

      final Element headerValueElement =
          AutoGeneratorUtility.generateDetailsElement(groupDefinition.getField(), computeElementType(groupDefinition));
      headerValueElement.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, "-");
     
      final Band headerElement = new Band();
      headerElement.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "inline");
      headerElement.getStyle().setStyleProperty(ElementStyleKeys.MIN_WIDTH, new Float(-100));
      headerElement.getStyle().setStyleProperty(ElementStyleKeys.DYNAMIC_HEIGHT, Boolean.TRUE);
      headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE,
          AttributeNames.Wizard.ALLOW_METADATA_STYLING, Boolean.TRUE);
      headerElement.setAttribute
          (AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.LABEL_FOR, groupDefinition.getField());
      headerElement.setAttribute(AttributeNames.Wizard.NAMESPACE, "CachedWizardFormatData", headerDefinition);
      headerElement.addElement(headerLabelElement);
      headerElement.addElement(headerValueElement);
      content.clear();
      content.addElement(headerElement);
    }
  }
View Full Code Here


    return null;
  }

  public Object getObject()
  {
    final Band band = (Band) super.getObject();
    return new SourceChunk(band);
  }
View Full Code Here

  private ArrayList items;
  private Band band;

  public BandReadHandler()
  {
    band = new Band();
    this.bandFactory = new BandElementFactory (band);
    this.items = new ArrayList();
  }
View Full Code Here

      return result;
    }

    // we need to intercept for <UL> and <OL> here

    final Band band = new Band();
    configureStyle(textElement, band);
    configureBand(textElement, band);
    final boolean bandIsInline = isInlineElement(band);
    final int size = textElement.getElementCount();
    Band inlineContainer = null;
    for (int i = 0; i < size; i++)
    {
      final Element element = process(textElement.getElement(i));
      if (element == null)
      {
        continue;
      }

      if (isInlineElement(element) == bandIsInline)
      {
        band.addElement(element);
        continue;
      }

      if (band.getElementCount() == 0)
      {
        inlineContainer = new Band();
        inlineContainer.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "inline");
        inlineContainer.addElement(element);
        band.addElement(inlineContainer);
        continue;
      }

      final Element maybeInlineContainer = (Element) band.getElement(band.getElementCount() - 1);
      if (maybeInlineContainer == inlineContainer)
      {
        // InlineContainer cannot be null at this point, as band.getElement never returns null.
        //noinspection ConstantConditions
        inlineContainer.addElement(element);
        continue;
      }

      inlineContainer = new Band();
      inlineContainer.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "inline");
      inlineContainer.addElement(element);
      band.addElement(inlineContainer);
    }
    return band;
  }
View Full Code Here

  }

  public static Band convertToBand(final StyleKey[] definedStyleKeys,
                                    final Element element, final Element child)
  {
    final Band b = new Band(element.getObjectID());
    final ElementStyleSheet targetStyle = b.getStyle();
    final ElementStyleSheet sourceStyle = element.getStyle();
    for (int i = 0; i < definedStyleKeys.length; i++)
    {
      // copy all, even the inherited styles, as we do not add the element/band to the real parent. All we do
      // is virtual ..
      final StyleKey key = definedStyleKeys[i];
      targetStyle.setStyleProperty(key, sourceStyle.getStyleProperty(key));
    }

    final String[] attrNs = element.getAttributeNamespaces();
    for (int i = 0; i < attrNs.length; i++)
    {
      final String attrNamespace = attrNs[i];
      final String[] attrNames = element.getAttributeNames(attrNamespace);
      for (int j = 0; j < attrNames.length; j++)
      {
        final String attrName = attrNames[j];
        final Object attrValue = element.getAttribute(attrNamespace, attrName);
        b.setAttribute(attrNamespace, attrName, attrValue);
      }
    }
    b.addElement(child);
    b.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "block");
    return b;
  }
View Full Code Here

  {
    outputFunction.updateFooterArea(event);
    final Renderer renderer = outputFunction.getRenderer();
    final int gidx = event.getState().getCurrentGroupIndex();
    final Group g = event.getReport().getGroup(gidx);
    final Band b = g.getHeader();
    renderer.startGroup(g);
    renderer.startSection(Renderer.TYPE_NORMALFLOW);
    outputFunction.print(outputFunction.getRuntime(), b);
    outputFunction.addSubReportMarkers(renderer.endSection());
    renderer.startGroupBody(g.getBody());
View Full Code Here

    final Renderer renderer = outputFunction.getRenderer();
    outputFunction.updateFooterArea(event);

    final int gidx = event.getState().getCurrentGroupIndex();
    final Group g = event.getReport().getGroup(gidx);
    final Band b = g.getFooter();

    renderer.endGroupBody();
    renderer.startSection(Renderer.TYPE_NORMALFLOW);
    outputFunction.print(outputFunction.getRuntime(), b);
    outputFunction.addSubReportMarkers(renderer.endSection());
View Full Code Here

      {
        return value;
      }

      final Element element = process(doc.getDefaultRootElement());
      final Band band = RichTextConverterUtilities.convertToBand(StyleKey.getDefinedStyleKeys(), source, element);
      band.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, "inline");
      return band;
    }
    catch (Exception e)
    {
      return value;
View Full Code Here

      result.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, text);
      configureStyle(textElement.getAttributes(), result);
      return result;
    }

    final Band band = new Band();
    configureStyle(textElement.getAttributes(), band);
    configureBand(textElement, band);
    final int size = textElement.getElementCount();
    for (int i = 0; i < size; i++)
    {
      final Element element = process(textElement.getElement(i));
      band.addElement(element);
    }
    return band;
  }
View Full Code Here

        continue;
      }

      if (element instanceof Band)
      {
        final Band childBand = (Band) element;
        add(box, childBand, runtime, stateKey);
        continue;
      }

      if (element instanceof SubReport)
      {
        performAddInlineSubReport(runtime, stateKey, box, (SubReport) element);
        continue;
      }

      final Object value = computeValue(runtime, element);
      if (value instanceof Element)
      {
        final Band b = RichTextConverterUtilities.convertToBand(definedStyleKeys, element, (Element) value);
        add(box, b, runtime, stateKey);
      }
      else
      {
        performRenderValue(runtime, stateKey, box, element, value);
View Full Code Here

TOP

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

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.