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

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


   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();

    final CrosstabGroup group = (CrosstabGroup) getElement();
    if (headerReadHandler != null)
    {
      group.setHeader((GroupHeader) headerReadHandler.getElement());
    }
    if (footerReadHandler != null)
    {
      group.setFooter((GroupFooter) footerReadHandler.getElement());
    }
    if (groupBodyReadHandler != null)
    {
      group.setBody(groupBodyReadHandler.getGroupBody());
    }
  }
View Full Code Here


    }
  }

  protected Element createElement(final String elementType)
  {
    return new CrosstabGroup();
  }
View Full Code Here

    return definition;
  }

  private void clearCrosstab()
  {
    final CrosstabGroup crosstabGroup = lookupCrosstab();
    if (crosstabGroup != null)
    {
      if (definition.getRootGroup() == crosstabGroup)
      {
        definition.setRootGroup(new RelationalGroup());
      }
      else
      {
        final Section parentSection = crosstabGroup.getParentSection();
        if (parentSection instanceof SubGroupBody)
        {
          final SubGroupBody sgb = (SubGroupBody) parentSection;
          sgb.setGroup(new RelationalGroup());
        }
View Full Code Here

   *
   * @throws ReportProcessingException if an error occurs.
   */
  private void setupCrosstab() throws ReportProcessingException
  {
    CrosstabGroup crosstab = lookupCrosstab();
    if (crosstab == null)
    {
      crosstab = new CrosstabGroup();
      insertCrosstab(crosstab);
    }

    Group insertGroup = crosstab;
    final GroupDefinition[] groupDefinitions = wizardSpecification.getGroupDefinitions();
View Full Code Here

    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();
        }
View Full Code Here

  @Test
  public void testSelectionOnCrosstabGroup() {
    WorkspaceSettings.getInstance().setExperimentalFeaturesVisible(true);

    final MasterReport report = new MasterReport();
    report.setRootGroup(new CrosstabGroup());

    final TestReportDesignerContext rdc = new TestReportDesignerContext();
    rdc.addMasterReport(report);
    rdc.setActiveDocument(rdc.getDocumentContext(0));
    final ReportDocumentContext activeContext = rdc.getActiveContext();
View Full Code Here

  @Test
  public void testCreateUndoActionOnMasterReport() {
    WorkspaceSettings.getInstance().setExperimentalFeaturesVisible(true);

    final MasterReport report = new MasterReport();
    CrosstabGroup rootGroup = new CrosstabGroup();
    report.setRootGroup(rootGroup);

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

    activeContext.getSelectionModel().add(rootGroup);

    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(), report.getRootGroup().getObjectID());

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

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

    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

    WorkspaceSettings.getInstance().setExperimentalFeaturesVisible(true);

    final MasterReport report = new MasterReport();
    final CrosstabElement element = new CrosstabElement();

    CrosstabGroup rootGroup = new CrosstabGroup();

    RelationalGroup relGroup = new RelationalGroup();
    relGroup.setBody(new SubGroupBody(rootGroup));
    element.setRootGroup(relGroup);

    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().getBody().getGroup().getObjectID());

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

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

      {
        final String column = (String) otherFieldsModel.get(other);
        builder.addOtherDimension(column);
      }

      final CrosstabGroup crosstabGroup = builder.create();
      optionsPane.setValuesOnGroup(crosstabGroup);
      return crosstabGroup;
    }
    finally
    {
View Full Code Here

TOP

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

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.