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

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


  }

  public static CrosstabBuilder populateBuilder(final CrosstabGroup editedGroup,
                                                final ContextAwareDataSchemaModel reportDataSchemaModel)
  {
    CrosstabCellBody cellBody = null;
    Group group = editedGroup.getBody().getGroup();

    ArrayList<CrosstabRowGroup> rows = new ArrayList<CrosstabRowGroup>();
    ArrayList<CrosstabColumnGroup> cols = new ArrayList<CrosstabColumnGroup>();
    ArrayList<CrosstabOtherGroup> others = new ArrayList<CrosstabOtherGroup>();

    while (group != null)
    {
      if (group instanceof CrosstabOtherGroup)
      {
        CrosstabOtherGroup otherGroup = (CrosstabOtherGroup) group;
        others.add(otherGroup);
      }
      else if (group instanceof CrosstabRowGroup)
      {
        CrosstabRowGroup rowGroup = (CrosstabRowGroup) group;
        rows.add(rowGroup);
      }
      else if (group instanceof CrosstabColumnGroup)
      {
        CrosstabColumnGroup colGroup = (CrosstabColumnGroup) group;
        cols.add(colGroup);
      }
      else
      {
        break;
      }

      GroupBody body = group.getBody();
      if (body instanceof CrosstabCellBody)
      {
        cellBody = (CrosstabCellBody) body;
        break;
      }

      group = body.getGroup();
    }

    if (cellBody == null)
    {
      throw new IllegalStateException("A crosstab group can never be without a cell body");
    }

    LinkedHashMap<String, DetailsDefinition> details;
    CrosstabCell element = cellBody.findElement(null, null);
    if (element != null)
    {
      details = extractFromDetailCell(element, cellBody.getHeader());
    }
    else
    {
      details = new LinkedHashMap<String, DetailsDefinition>();
    }
View Full Code Here


      return null;
    }

    if (rawLeadSelection instanceof CrosstabCellBody)
    {
      final CrosstabCellBody body = (CrosstabCellBody) rawLeadSelection;
      if (insert instanceof CrosstabCell)
      {
        final CrosstabCell crosstabCell = (CrosstabCell) insert.derive();
        body.addElement(crosstabCell);
        return crosstabCell;
      }
    }

    return null;
View Full Code Here

      }
      if (selectedElement instanceof CrosstabCellBody)
      {
        // execution order is important here.
        // first unlink the old root-group by setting a new one ...
        final CrosstabCellBody selectedGroup = (CrosstabCellBody) selectedElement;
        final CrosstabCell crosstabCell = new CrosstabCell();
        selectedGroup.addElement(crosstabCell);

        activeContext.getUndo().addChange(ActionMessages.getString("InsertCrosstabCellAction.UndoName"),
            new InsertCellBodyUndoEntry(selectedGroup.getObjectID(), crosstabCell));
      }
    }
    catch (Exception ex)
    {
      UncaughtExceptionsModel.getInstance().addException(ex);
View Full Code Here

      this.cell = cell;
    }

    public void undo(final ReportDocumentContext renderContext)
    {
      final CrosstabCellBody selectedGroup = (CrosstabCellBody)
              ModelUtility.findElementById(renderContext.getReportDefinition(), target);
      selectedGroup.removeElement(cell);
    }
View Full Code Here

      selectedGroup.removeElement(cell);
    }

    public void redo(final ReportDocumentContext renderContext)
    {
      final CrosstabCellBody selectedGroup = (CrosstabCellBody)
              ModelUtility.findElementById(renderContext.getReportDefinition(), target);
      selectedGroup.addElement(cell);
    }
View Full Code Here

      return;
    }

    if (event.getState().isCrosstabActive())
    {
      final CrosstabCellBody crosstabCellBody = event.getReport().getCrosstabCellBody();
      processRootBand(crosstabCellBody.getHeader());
      processRootBand(crosstabCellBody.findElement(null, null));
    }
    else
    {
      final ReportDefinition reportDefinition = event.getReport();
      processRootBand(reportDefinition.getDetailsHeader());
View Full Code Here

      return;
    }

    if (event.getState().isCrosstabActive())
    {
      final CrosstabCellBody crosstabCellBody = event.getReport().getCrosstabCellBody();
      processRootBand(crosstabCellBody.findElement(null, null));
    }
    else
    {
      final ItemBand itemBand = event.getReport().getItemBand();
      processRootBand(itemBand);
View Full Code Here

      return;
    }

    if (event.getState().isCrosstabActive())
    {
      final CrosstabCellBody crosstabCellBody = event.getReport().getCrosstabCellBody();
      processRootBand(crosstabCellBody.findElement(null, null));
    }
    else
    {
      processRootBand(event.getReport().getDetailsFooter());
    }
View Full Code Here


    final Group group = FunctionUtilities.getCurrentGroup(event);
    if (group instanceof CrosstabColumnGroup)
    {
      final CrosstabCellBody crosstabCellBody = event.getReport().getCrosstabCellBody();
      final int elementCount = crosstabCellBody.getElementCount();
      for (int i = 1; i < elementCount; i += 1)
      {
        final CrosstabCell cell = (CrosstabCell) crosstabCellBody.getElement(i);
        if (cell.getRowField() == null)
        {
          processRootBand(cell);
        }
      }
    }
    else if (group instanceof CrosstabRowGroup)
    {
      final CrosstabRowGroup rowGroup = (CrosstabRowGroup) group;
      final CrosstabCellBody crosstabCellBody = event.getReport().getCrosstabCellBody();
      final int elementCount = crosstabCellBody.getElementCount();
      for (int i = 1; i < elementCount; i += 1)
      {
        final CrosstabCell cell = (CrosstabCell) crosstabCellBody.getElement(i);
        if (ObjectUtilities.equal(cell.getRowField(), rowGroup.getField()))
        {
          processRootBand(cell);
        }
      }
View Full Code Here

   * @throws org.xml.sax.SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();
    final CrosstabCellBody body = getElement();
    if (detailsHeaderReadHandler != null)
    {
      body.setHeader(detailsHeaderReadHandler.getElement());
    }
    for (int i = 0; i < crosstabCellReadHandlers.size(); i++)
    {
      final CrosstabCellReadHandler readHandler = crosstabCellReadHandlers.get(i);
      body.addElement(readHandler.getElement());
    }
  }
View Full Code Here

TOP

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

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.