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

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


    if (FunctionUtilities.isDefinedGroup("conditional-level-group", event) == false)
    {
      return;
    }
    // and if so, then get a reference to that group
    final Group group = FunctionUtilities.getCurrentGroup(event);

    // check, if all required bands are defined and return if one
    // of them is missing.
    final Element normalItemBand =
        event.getReport().getItemBand().getElement("FirstLevel");
    final Element nestedItemBand =
        event.getReport().getItemBand().getElement("SecondLevel");
    if (normalItemBand == null || nestedItemBand == null)
    {
      return;
    }

    // and now apply the visiblity to all bands affected
    final boolean isNestedGroup =
        (event.getDataRow().get("level-two-account") != null);
    //Log.warn("Is Nested Group: " + event.getDataRow().get("level-one-account") + " -> " + isNestedGroup);
    if (isNestedGroup)
    {
      normalItemBand.setVisible(false);
      nestedItemBand.setVisible(true);
      group.getHeader().setVisible(true);
      group.getFooter().setVisible(true);
    }
    else
    {
      normalItemBand.setVisible(true);
      nestedItemBand.setVisible(false);
      group.getHeader().setVisible(false);
      group.getFooter().setVisible(false);
    }
  }
View Full Code Here


    return null;
  }

  private void insertGroup(final RelationalGroup group)
  {
    Group lastGroup = null;
    Group insertGroup = definition.getRootGroup();
    while (true)
    {
      if (insertGroup instanceof RelationalGroup == false)
      {
        if (lastGroup == null)
        {
          definition.setRootGroup(group);
          group.setBody(new SubGroupBody(insertGroup));
          return;
        }

        final GroupBody body = lastGroup.getBody();
        final SubGroupBody sgb = new SubGroupBody(group);
        lastGroup.setBody(sgb);
        group.setBody(body);
        return;
      }

      final GroupBody body = insertGroup.getBody();
      if (body instanceof SubGroupBody == false)
      {
        final SubGroupBody sgb = new SubGroupBody(group);
        insertGroup.setBody(sgb);
        group.setBody(body);
        return;
      }

      lastGroup = insertGroup;
View Full Code Here

  public void groupStarted(final ReportEvent event)
  {
    final ReportState state = event.getState();
    if (event.getLevel() == getDependencyLevel())
    {
      final Group group = event.getReport().getGroup(state.getCurrentGroupIndex());
      if (group instanceof CrosstabGroup)
      {
        final CrosstabGroup crosstabGroup = (CrosstabGroup) group;
        // yeay! we encountered a crosstab.
        if (processingStack == null)
        {
          processingStack = new FastStack();
        }
        final String[] columnSet = computeColumns(crosstabGroup);
        final ReportStateKey processKey = state.getProcessKey();
        final DataSchema dataSchema = getRuntime().getDataSchema();
        final DataAttributes tableAttributes = dataSchema.getTableAttributes();
        final DataAttributeContext context = new DefaultDataAttributeContext
            (getRuntime().getProcessingContext().getOutputProcessorMetaData(),
                getRuntime().getResourceBundleFactory().getLocale());

        final String mode = (String) tableAttributes.getMetaAttribute
            (MetaAttributeNames.Core.NAMESPACE, MetaAttributeNames.Core.CROSSTAB_MODE, String.class, context);
        if ("normalized".equals(mode))
        {
          processingStack.push(new OrderedMergeCrosstabSpecification(processKey, columnSet));
        }
        else
        {
          processingStack.push(new SortedMergeCrosstabSpecification(processKey, columnSet));
        }
        return;
      }

      if (processingStack == null || processingStack.isEmpty())
      {
        return;
      }

      final CrosstabSpecification csstate = (CrosstabSpecification) processingStack.peek();
      if (csstate == null)
      {
        return;
      }

      if (group instanceof CrosstabRowGroup)
      {
        if (group.getBody() instanceof CrosstabColumnGroupBody)
        {
          csstate.startRow();
        }
      }

      return;
    }

    if (results == null || processingStack == null || processingStack.isEmpty())
    {
      return;
    }

    // recall ..
    final Group group = event.getReport().getGroup(state.getCurrentGroupIndex());
    if (group instanceof CrosstabGroup)
    {
      final ReportStateKey processKey = state.getProcessKey();
      final CrosstabSpecification o = (CrosstabSpecification) results.get(processKey);
      if (o == null)
View Full Code Here

    }

    final ReportState state = event.getState();
    if (event.getLevel() == getDependencyLevel())
    {
      final Group group = event.getReport().getGroup(state.getCurrentGroupIndex());
      if (group instanceof CrosstabGroup)
      {
        final CrosstabSpecification cs = (CrosstabSpecification) processingStack.pop();
        if (results == null)
        {
          results = new HashMap();
        }
        results.put(cs.getKey(), cs);
        return;
      }

      if (group instanceof CrosstabRowGroup)
      {
        if (group.getBody() instanceof CrosstabColumnGroupBody)
        {
          csstate.endRow();
        }
      }
      return;
    }

    if (results == null)
    {
      return;
    }

    final Group group = event.getReport().getGroup(state.getCurrentGroupIndex());
    if (group instanceof CrosstabGroup)
    {
      processingStack.pop();
    }
  }
View Full Code Here

    while (body != null)
    {
      if (body instanceof SubGroupBody)
      {
        final SubGroupBody sgBody = (SubGroupBody) body;
        final Group g = sgBody.getGroup();
        body = g.getBody();
        continue;
      }

      if (body instanceof CrosstabOtherGroupBody)
      {
View Full Code Here

    final Element line = HorizontalLineElementFactory.createHorizontalLine(15);
    line.getStyle().setStyleProperty(ElementStyleKeys.STROKE, new BasicStroke(1));
    b.addElement(line);

    final Group group = report.getGroupByName("record-group");
    group.getHeader().addElement(b);
  }
View Full Code Here

   *
   * @return The item band.
   */
  public ItemBand getItemBand()
  {
    final Group group = getInnerMostGroup();
    final GroupDataBody dataBody = (GroupDataBody) group.getBody();
    return dataBody.getItemBand();
  }
View Full Code Here

   *
   * @return The details header band.
   */
  public DetailsHeader getDetailsHeader()
  {
    final Group group = getInnerMostGroup();
    final GroupDataBody dataBody = (GroupDataBody) group.getBody();
    return dataBody.getDetailsHeader();
  }
View Full Code Here

   *
   * @return The details header  band.
   */
  public DetailsFooter getDetailsFooter()
  {
    final Group group = getInnerMostGroup();
    final GroupDataBody dataBody = (GroupDataBody) group.getBody();
    return dataBody.getDetailsFooter();
  }
View Full Code Here

    return rootGroup;
  }

  private Group getInnerMostGroup()
  {
    Group existingGroup = rootGroup;
    GroupBody gb = existingGroup.getBody();
    while (gb != null)
    {
      final int count = gb.getElementCount();
      GroupBody locatedBody = null;
      for (int i = 0; i < count; i++)
      {
        final ReportElement element = gb.getElement(i);
        if (element instanceof Group)
        {
          existingGroup = (Group) element;
          locatedBody = existingGroup.getBody();
          break;
        }
      }
      if (locatedBody == null)
      {
View Full Code Here

TOP

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

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.