Package net.sf.jasperreports.crosstabs

Examples of net.sf.jasperreports.crosstabs.JRCrosstabRowGroup


  {
    JRCrosstabRowGroup[] groups = crosstab.getRowGroups();
   
    for (int i = 0, x = 0, y = 0; i < groups.length; i++)
    {
      JRCrosstabRowGroup group = groups[i];
     
      if (group.getTotalPositionValue() == CrosstabTotalPositionEnum.START)
      {
        JRCellContents totalHeader = group.getTotalHeader();
        if (totalHeader.getWidth() != 0 && totalHeader.getHeight() != 0)
        {
          crosstabElements.add(
            getCrosstabCellFrame(
              reportConverter,
              totalHeader,
              x,
              colHeadersYOffset + y,
              false,
              false,
              y == 0 && crosstab.getHeaderCell() == null
              ));
         
          addCrosstabDataCellsRow(
            reportConverter,
            crosstab,
            rowHeadersXOffset,
            colHeadersYOffset + y,
            i,
            crosstabElements
            );
          y += totalHeader.getHeight();
        }
      }
     
      JRCellContents header = group.getHeader();
      if (header.getWidth() != 0 && header.getHeight() != 0)
      {
        crosstabElements.add(
          getCrosstabCellFrame(
            reportConverter,
            header,
            x,
            colHeadersYOffset + y,
            false,
            false,
            y == 0 && crosstab.getHeaderCell() == null
            ));
      }
     
      if (i == groups.length - 1)
      {
        addCrosstabDataCellsRow(
          reportConverter,
          crosstab,
          rowHeadersXOffset,
          colHeadersYOffset + y,
          groups.length,
          crosstabElements
          );       
      }
     
      if (group.getTotalPositionValue() == CrosstabTotalPositionEnum.END)
      {
        JRCellContents totalHeader = group.getTotalHeader();
        if (totalHeader.getWidth() != 0 && totalHeader.getHeight() != 0)
        {
          crosstabElements.add(
            getCrosstabCellFrame(
              reportConverter,
              totalHeader,
              x,
              colHeadersYOffset + y + header.getHeight(),
              false,
              false,
              false
              ));
         
          addCrosstabDataCellsRow(
            reportConverter,
            crosstab,
            rowHeadersXOffset,
            colHeadersYOffset + y + header.getHeight(),
            i,
            crosstabElements
            );
        }
      }
     
      x += group.getWidth();
    }
  }
View Full Code Here


   
    Map totalVarPos = new HashMap();
    totalVariables = new JRFillVariable[rowGroups.length + 1][columnGroups.length + 1][measures.length];
    for (int row = 0; row <= rowGroups.length; ++row)
    {
      JRCrosstabRowGroup rowGroup = row == rowGroups.length ? null : rowGroups[row];
      for (int col = 0; col <= columnGroups.length; ++col)
      {
        JRCrosstabColumnGroup colGroup = col == columnGroups.length ? null : columnGroups[col];
       
        if (row < rowGroups.length || col < columnGroups.length)
View Full Code Here

    visitCrosstabCell(crosstab.getHeaderCell());
   
    JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
    for (int i = 0; i < rowGroups.length; i++)
    {
      JRCrosstabRowGroup rowGroup = rowGroups[i];
      visitCrosstabCell(rowGroup.getHeader());
      visitCrosstabCell(rowGroup.getTotalHeader());
    }
   
    JRCrosstabColumnGroup[] columnGroups = crosstab.getColumnGroups();
    for (int i = 0; i < columnGroups.length; i++)
    {
View Full Code Here

    JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
    if (rowGroups != null)
    {
      for (int i = 0; i < rowGroups.length; i++)
      {
        JRCrosstabRowGroup rowGroup = rowGroups[i];
        JRCrosstabBucket bucket = rowGroup.getBucket();
        datasetCollector.addExpression(bucket.getExpression());
        //order by expression is in the crosstab context
        crosstabCollector.addExpression(bucket.getOrderByExpression());
        addExpression(bucket.getComparatorExpression());
        crosstabCollector.collect(rowGroup.getHeader());
        crosstabCollector.collect(rowGroup.getTotalHeader());
      }
    }

    JRCrosstabColumnGroup[] colGroups = crosstab.getColumnGroups();
    if (colGroups != null)
View Full Code Here

      JRCrosstabMeasure measure = (JRCrosstabMeasure) measureIt.next();
      addTotalVar(measure, null, colGroup);

      for (Iterator rowIt = rowGroups.iterator(); rowIt.hasNext();)
      {
        JRCrosstabRowGroup rowGroup = (JRCrosstabRowGroup) rowIt.next();
        addTotalVar(measure, rowGroup, colGroup);
      }
    }
  }
View Full Code Here

      addTotalVar(measure, null, colGroup);
    }
   
    for (Iterator rowIt = rowGroups.iterator(); rowIt.hasNext();)
    {
      JRCrosstabRowGroup rowGroup = (JRCrosstabRowGroup) rowIt.next();
      addTotalVar(measure, rowGroup, null);
     
      for (Iterator colIt = columnGroups.iterator(); colIt.hasNext();)
      {
        JRCrosstabColumnGroup colGroup = (JRCrosstabColumnGroup) colIt.next();
View Full Code Here

   * @param groupName the group name
   * @return the removed group
   */
  public JRCrosstabRowGroup removeRowGroup(String groupName)
  {
    JRCrosstabRowGroup removed = null;
   
    Integer idx = (Integer) rowGroupsMap.remove(groupName);
    if (idx != null)
    {
      removed = (JRCrosstabRowGroup) rowGroups.remove(idx.intValue());
     
      for (ListIterator it = rowGroups.listIterator(idx.intValue()); it.hasNext();)
      {
        JRCrosstabRowGroup group = (JRCrosstabRowGroup) it.next();
        rowGroupsMap.put(group.getName(), Integer.valueOf(it.previousIndex()));
      }
     
      for (Iterator it = cellsList.iterator(); it.hasNext();)
      {
        JRCrosstabCell cell = (JRCrosstabCell) it.next();
View Full Code Here

      JRCrosstabMeasure measure = (JRCrosstabMeasure) measureIt.next();
      removeTotalVar(measure, null, colGroup);

      for (Iterator rowIt = rowGroups.iterator(); rowIt.hasNext();)
      {
        JRCrosstabRowGroup rowGroup = (JRCrosstabRowGroup) rowIt.next();
        removeTotalVar(measure, rowGroup, colGroup);
      }
    }
  }
View Full Code Here

      removeTotalVar(measure, null, colGroup);
    }
   
    for (Iterator rowIt = rowGroups.iterator(); rowIt.hasNext();)
    {
      JRCrosstabRowGroup rowGroup = (JRCrosstabRowGroup) rowIt.next();
      removeTotalVar(measure, rowGroup, null);
     
      for (Iterator colIt = columnGroups.iterator(); colIt.hasNext();)
      {
        JRCrosstabColumnGroup colGroup = (JRCrosstabColumnGroup) colIt.next();
View Full Code Here

      setTotalVarClass(measure, null, colGroup, valueClassName);
    }
   
    for (Iterator rowIt = rowGroups.iterator(); rowIt.hasNext();)
    {
      JRCrosstabRowGroup rowGroup = (JRCrosstabRowGroup) rowIt.next();
      setTotalVarClass(measure, rowGroup, null, valueClassName);
     
      for (Iterator colIt = columnGroups.iterator(); colIt.hasNext();)
      {
        JRCrosstabColumnGroup colGroup = (JRCrosstabColumnGroup) colIt.next();
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.crosstabs.JRCrosstabRowGroup

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.