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

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


    try
    {
      final Group g = event.getReport().getGroup(event.getState().getCurrentGroupIndex());
      if (g instanceof RelationalGroup)
      {
        RelationalGroup rg = (RelationalGroup) g;
        w.write("<groupfooter name=\"");
        w.write(entityParser.encodeEntities(g.getName()));
        w.write("\">");
        writeBand(rg.getFooter());
        w.write("</groupfooter>");
      }
    }
    catch (IOException ioe)
    {
View Full Code Here


      for (int gidx = level.getGroupIndex(); gidx >= 0; gidx -= 1)
      {
        final Group g = def.getGroup(gidx);
        if (g instanceof RelationalGroup)
        {
          final RelationalGroup rg = (RelationalGroup) g;
          final GroupFooter footer = rg.getFooter();
          bits.set(count, DefaultOutputFunction.isGroupSectionPrintable(footer, true, true));
          count += 1;
        }
      }

      if (level.isInItemGroup())
      {
        final DetailsFooter detailsFooter = def.getDetailsFooter();
        if (detailsFooter != null)
        {
          bits.set(count, DefaultOutputFunction.isGroupSectionPrintable(detailsFooter, true, true));
          count += 1;
        }
      }

    }


    /**
     * Repeating group header are only printed while ItemElements are
     * processed.
     */
    for (int gidx = groupsPrinted; gidx >= 0; gidx -= 1)
    {
      final Group g = report.getGroup(gidx);
      if (g instanceof RelationalGroup)
      {
        final RelationalGroup rg = (RelationalGroup) g;
        final GroupFooter footer = rg.getFooter();
        bits.set(count, DefaultOutputFunction.isGroupSectionPrintable(footer, false, true));
        count += 1;
      }
    }

View Full Code Here

    catch (NullPointerException npe)
    {
      // expected, ignored
    }

    final RelationalGroup g1 = new RelationalGroup();
    gl.add(g1);
    gl.add(g1);
    assertTrue(gl.size() == 1); // the old instance gets removed and replaced by the new group
    gl.add(new RelationalGroup());
    assertTrue(gl.size() == 1); // the old instance gets removed and replaced by the new group

    final RelationalGroup g2 = new RelationalGroup();
    g2.addField("Test");

    final RelationalGroup g3 = new RelationalGroup();
    g3.addField("Failure");

    // group g2 and g3 are unreleated, g2 is no child or parent of g3
    gl.add(g2);
    try
    {
View Full Code Here

  }


  private static RelationalGroup createGroup(String name, String[] fields)
  {
    final RelationalGroup group = new RelationalGroup();
    group.setFields(Arrays.asList(fields));
    group.setName(name);
    return group;
  }
View Full Code Here

  {
    MasterReport report = new MasterReport();
    report.getItemBand().setName("ItemBand!");

    final GroupList gl = new GroupList();
    gl.add(new RelationalGroup());
    gl.add(createGroup("second", new String[]{"field"}));
    gl.add(createGroup("third", new String[]{"field", "field2"}));
    gl.installIntoReport(report);

    // Only 3 groups, as the default group is replaced.
View Full Code Here

      for (int gidx = 0; gidx <= level.getGroupIndex(); gidx++)
      {
        final Group g = def.getGroup(gidx);
        if (g instanceof RelationalGroup)
        {
          final RelationalGroup rg = (RelationalGroup) g;
          final GroupHeader header = rg.getHeader();
          if (isGroupSectionPrintableInternal(header, true, true))
          {
            print(level.getRuntime(), header);
          }
        }
      }

      if (level.isInItemGroup())
      {
        final DetailsHeader detailsHeader = def.getDetailsHeader();
        if (detailsHeader != null && isGroupSectionPrintableInternal(detailsHeader, true, true))
        {
          print(level.getRuntime(), detailsHeader);
        }
      }
    }

    final int groupsPrinted = state.getPresentationGroupIndex();
    for (int gidx = 0; gidx <= groupsPrinted; gidx++)
    {
      final Group g = report.getGroup(gidx);
      if (g instanceof RelationalGroup)
      {
        final RelationalGroup rg = (RelationalGroup) g;
        final GroupHeader header = rg.getHeader();
        if (isGroupSectionPrintableInternal(header, false, true))
        {
          if (runtime == null)
          {
            runtime = createRuntime(state.getFlowController().getMasterRow(), state, processingContext);
View Full Code Here

    for (int gidx = groupsPrinted; gidx >= 0; gidx -= 1)
    {
      final Group g = report.getGroup(gidx);
      if (g instanceof RelationalGroup)
      {
        final RelationalGroup rg = (RelationalGroup) g;
        final GroupFooter footer = rg.getFooter();
        if (isGroupSectionPrintableInternal(footer, false, true))
        {
          print(getRuntime(), footer);
        }
      }
    }

    for (int i = 0; i < levelCount; i++)
    {
      final LayouterLevel level = levels[i];
      final ReportDefinition def = level.getReportDefinition();

      if (level.isInItemGroup())
      {
        final DetailsFooter detailsFooter = def.getDetailsFooter();
        if (detailsFooter != null)
        {
          if (isGroupSectionPrintableInternal(detailsFooter, true, true))
          {
            print(level.getRuntime(), detailsFooter);
          }
        }
      }

      for (int gidx = level.getGroupIndex(); gidx >= 0; gidx -= 1)
      {
        final Group g = def.getGroup(gidx);
        if (g instanceof RelationalGroup)
        {
          final RelationalGroup rg = (RelationalGroup) g;
          final GroupFooter footer = rg.getFooter();
          if (isGroupSectionPrintableInternal(footer, true, true))
          {
            print(level.getRuntime(), footer);
          }
        }
View Full Code Here

      for (int gidx = groupsPrinted; gidx >= 0; gidx -= 1)
      {
        final Group g = report.getGroup(gidx);
        if (g instanceof RelationalGroup)
        {
          final RelationalGroup rg = (RelationalGroup) g;
          final GroupFooter footer = rg.getFooter();
          if (isGroupSectionPrintableInternal(footer, false, true) &&
              elementChangeChecker.isBandChanged(footer, dataRow))
          {
            needPrinting = true;
          }
        }
      }
    }

    if (needPrinting == false)
    {
      for (int i = 0; i < levelCount; i++)
      {
        final LayouterLevel level = levels[i];
        final ReportDefinition def = level.getReportDefinition();

        if (level.isInItemGroup())
        {
          final DetailsFooter detailsFooter = def.getDetailsFooter();
          if (detailsFooter != null)
          {
            if (isGroupSectionPrintableInternal(detailsFooter, true, true) &&
                elementChangeChecker.isBandChanged(detailsFooter, dataRow))
            {
              needPrinting = true;
            }
          }
        }

        if (needPrinting == false)
        {
          for (int gidx = level.getGroupIndex(); gidx >= 0; gidx -= 1)
          {
            final Group g = def.getGroup(gidx);
            if (g instanceof RelationalGroup)
            {
              final RelationalGroup rg = (RelationalGroup) g;
              final GroupFooter footer = rg.getFooter();
              if (isGroupSectionPrintableInternal(footer, true, true) &&
                  elementChangeChecker.isBandChanged(footer, dataRow))
              {
                needPrinting = true;
              }
View Full Code Here

    final Resource directly = resourceManager.createDirectly(url, MasterReport.class);
    final MasterReport org = (MasterReport) directly.getResource();

    final MasterReport report = postProcess(org);

    RelationalGroup relationalGroup = report.getRelationalGroup(0);
    GroupHeader header = relationalGroup.getHeader();
    Band band = (Band) header.getElement(0);
    Element element = band.getElement(1);
    assertTrue (element.getElementType() instanceof ResourceMessageType);
    element.setName("DateTitleField");
//    LogicalPageBox logicalPageBox = DebugReportRunner.layoutPage(report, 1);
View Full Code Here

    return report;
  }

  public RelationalGroup create()
  {
    RelationalGroup rootGroup = null;
    RelationalGroup innerGroup = null;

    boolean headerPrinted = false;

    if (groups.size() <= 0)
    {
      rootGroup = new RelationalGroup();
      innerGroup = rootGroup;
      headerPrinted = false;
    }
    else
    {
      for (int i = 0; i < groups.size(); i += 1)
      {
        headerPrinted |= groups.get(i).isHeader();
      }

      for (int i = 0; i < groups.size(); i += 1)
      {
        final GroupDefinition groupDefinition = groups.get(i);
        final RelationalGroup g = new RelationalGroup();
        g.addField(groupDefinition.getGroupField());
        g.setName(computeGroupName(groupDefinition));
        configureGroupHeader(groupDefinition, g, headerPrinted);
        configureGroupFooter(groupDefinition, g, headerPrinted);
        if (rootGroup == null)
        {
          rootGroup = g;
View Full Code Here

TOP

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

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.