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

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


    next.fireReportEvent();

    final CrosstabSpecification cs = findCrosstabSpecification(next);
    final DefaultFlowController controller = next.getFlowController().startCrosstabMode(cs);
    next.setFlowController(controller);
    final Group group = next.getReport().getGroup(next.getCurrentGroupIndex());
    return InlineSubreportProcessor.processInline(next, group.getHeader());
  }
View Full Code Here


    throw new ReportProcessingException("Failed to locate crosstab-spec, cannot continue.");
  }

  public ProcessState commit(final ProcessState next) throws ReportProcessingException
  {
    final Group group = next.getReport().getGroup(next.getCurrentGroupIndex());

    final GroupBody body = group.getBody();
    if (body instanceof CrosstabRowGroupBody)
    {
      next.setAdvanceHandler(BeginCrosstabRowAxisHandler.HANDLER);
    }
    else if (body instanceof CrosstabOtherGroupBody)
    {
      next.setAdvanceHandler(BeginCrosstabOtherAxisHandler.HANDLER);
    }
    else
    {
      throw new IllegalStateException("This report is totally messed up!");
    }

    final RootLevelBand rootLevelBand = group.getHeader();
    return InlineSubreportProcessor.process(next, rootLevelBand);
  }
View Full Code Here

    return state.deriveForAdvance();
  }

  public ProcessState commit(final ProcessState next) throws ReportProcessingException
  {
    final Group group = next.getReport().getGroup(next.getCurrentGroupIndex());

    final DefaultFlowController fc = next.getFlowController().performAdvance();
    final DefaultFlowController cfc = fc.performCommit();
    if (ProcessState.isLastItemInGroup(group, fc.getMasterRow(), cfc.getMasterRow()))
    {
View Full Code Here

  public ProcessState advance(final ProcessState state) throws ReportProcessingException
  {
    final ProcessState next = state.deriveForAdvance();
    next.fireReportEvent();
    final Group group = next.getReport().getGroup(next.getCurrentGroupIndex());
    return InlineSubreportProcessor.processInline(next, group.getFooter());
  }
View Full Code Here

  public ProcessState commit(final ProcessState next) throws ReportProcessingException
  {
    next.setAdvanceHandler(JoinEndCrosstabColumnAxisHandler.HANDLER);

    final Group group = next.getReport().getGroup(next.getCurrentGroupIndex());
    final RootLevelBand rootLevelBand = group.getFooter();
    return InlineSubreportProcessor.process(next, rootLevelBand);
  }
View Full Code Here

  private List<SortConstraint> collectSortData(final Group rootGroup,
                                               final ArrayList<SortConstraint> sorts)
  {
    sorts.addAll(rootGroup.getSortingConstraint());
    GroupBody body = rootGroup.getBody();
    Group group = body.getGroup();
    if (group == null)
    {
      // todo: Allow additional sorting based on item/detail data?
      return sorts;
    }
View Full Code Here

  public void testCreateUndoActionOnCrosstabReport() {
    WorkspaceSettings.getInstance().setExperimentalFeaturesVisible(true);

    final MasterReport report = new MasterReport();
    final CrosstabElement element = new CrosstabElement();
    Group rootGroup = element.getRootGroup();
    report.getReportHeader().addElement(element);

    final TestReportDesignerContext rdc = new TestReportDesignerContext();
    rdc.addMasterReport(report);
    rdc.addSubReport((ReportDocumentContext) rdc.getDocumentContext(0), element);
    rdc.setActiveDocument(rdc.getDocumentContext(1));
    final ReportDocumentContext activeContext = rdc.getActiveContext();
    Assert.assertNotNull(activeContext);
    Assert.assertEquals(activeContext.getReportDefinition(), element);

    CrosstabGroup crosstabGroup = new CrosstabGroup();

    EditCrosstabAction action = new NonEditingCrosstabAction(crosstabGroup);
    action.setReportDesignerContext(rdc);
    action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "Edit"));
    Assert.assertFalse(rdc.getActiveContext().getUndo().isRedoPossible());
    Assert.assertTrue(rdc.getActiveContext().getUndo().isUndoPossible());
    Assert.assertEquals(crosstabGroup.getObjectID(), element.getRootGroup().getObjectID());

    rdc.getActiveContext().getUndo().undo(rdc.getActiveContext());
    Assert.assertEquals(rootGroup.getObjectID(), element.getRootGroup().getObjectID());

    rdc.getActiveContext().getUndo().redo(rdc.getActiveContext());
    Assert.assertEquals(crosstabGroup.getObjectID(), element.getRootGroup().getObjectID());
  }
View Full Code Here

    }

    final Group[] groups = collectGroups();
    for (int i = 0; i < groups.length; i++)
    {
      final Group group = groups[i];
      if (group instanceof RelationalGroup)
      {
        final RelationalGroup relationalGroup = (RelationalGroup) group;
        if (ModelUtility.isHideInLayoutGui(relationalGroup.getHeader()) == false)
        {
          rootBandComponents.add(new RootBandRenderer(relationalGroup.getHeader(), renderContext));
        }
      }

      final Element bodyElement = group.getBody();
      if (bodyElement instanceof GroupDataBody)
      {
        final GroupDataBody body = (GroupDataBody) bodyElement;
        if (ModelUtility.isHideInLayoutGui(body.getDetailsHeader()) == false)
        {
          rootBandComponents.add(new RootBandRenderer(body.getDetailsHeader(), renderContext));
        }
        if (ModelUtility.isHideInLayoutGui(body.getNoDataBand()) == false)
        {
          rootBandComponents.add(new RootBandRenderer(body.getNoDataBand(), renderContext));
        }
        if (ModelUtility.isHideInLayoutGui(body.getItemBand()) == false)
        {
          rootBandComponents.add(new RootBandRenderer(body.getItemBand(), renderContext));
        }
        if (ModelUtility.isHideInLayoutGui(body.getDetailsFooter()) == false)
        {
          rootBandComponents.add(new RootBandRenderer(body.getDetailsFooter(), renderContext));
        }
        break;
      }
      else if (group instanceof CrosstabGroup)
      {
        rootBandComponents.add(new CrosstabRenderer((CrosstabGroup) group, renderContext));
        break;
      }
    }

    for (int i = groups.length - 1; i >= 0; i -= 1)
    {
      final Group group = groups[i];
      if (group instanceof RelationalGroup)
      {
        final RelationalGroup relationalGroup = (RelationalGroup) group;
        if (ModelUtility.isHideInLayoutGui(relationalGroup.getFooter()) == false)
        {
View Full Code Here

    return false;
  }

  private Group[] collectGroups()
  {
    Group group = report.getRootGroup();
    final ArrayList<Group> list = new ArrayList<Group>();
    while (group != null)
    {
      list.add(group);

      final Element bodyElement = group.getBody();
      if (bodyElement instanceof SubGroupBody)
      {
        final SubGroupBody body = (SubGroupBody) bodyElement;
        group = body.getGroup();
        continue;
View Full Code Here

    return null;
  }

  public static GroupDataEntry[] buildGroupData(final AbstractReportDefinition abstractReportDefinition)
  {
    Group group = abstractReportDefinition.getRootGroup();
    final ArrayList<GroupDataEntry> data = new ArrayList();
    while (group instanceof RelationalGroup)
    {
      final RelationalGroup rgroup = (RelationalGroup) group;
      data.add(new GroupDataEntry(group.getObjectID(), group.getName(), rgroup.getFieldsArray()));

      final GroupBody body = rgroup.getBody();
      if (body instanceof SubGroupBody)
      {
        final SubGroupBody subGroupBody = (SubGroupBody) body;
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.