Package net.sf.jasperreports.crosstabs

Examples of net.sf.jasperreports.crosstabs.JRCrosstabCell


      {
        JRCrosstabColumnGroup group = colGroups[i];
       
        if (group.getTotalPositionValue() == CrosstabTotalPositionEnum.START)
        {
          JRCrosstabCell cell = cells[rowIndex][i];
          if (cell != null)
          {
            JRCellContents contents = cell.getContents();
            if (contents.getWidth() != 0 && contents.getHeight() != 0)
            {
              crosstabElements.add(
                getCrosstabCellFrame(
                  reportConverter,
                  contents,
                  crosstabX + x,
                  crosstabY,
                  false,
                  false,
                  false
                  ));
              x += cells[rowIndex][i].getContents().getWidth();
            }
          }
        }
       
        if (i == colGroups.length - 1)
        {
          JRCrosstabCell cell = cells[rowIndex][colGroups.length];
          if (cell != null)
          {
            JRCellContents contents = cell.getContents();
            if (contents.getWidth() != 0 && contents.getHeight() != 0)
            {
              crosstabElements.add(
                getCrosstabCellFrame(
                  reportConverter,
                  contents,
                  crosstabX + x,
                  crosstabY,
                  false,
                  false,
                  false
                  ));
            }
          }
        }
       
        if (group.getTotalPositionValue() == CrosstabTotalPositionEnum.END)
        {
          JRCrosstabCell cell = cells[rowIndex][i];
          if (cell != null)
          {
            JRCellContents contents = cell.getContents();
            if (contents.getWidth() != 0 && contents.getHeight() != 0)
            {
              crosstabElements.add(
                getCrosstabCellFrame(
                  reportConverter,
View Full Code Here


    if (crosstab instanceof JRDesignCrosstab)
    {
      List cells = ((JRDesignCrosstab) crosstab).getCellsList();
      for (Iterator it = cells.iterator(); it.hasNext();)
      {
        JRCrosstabCell cell = (JRCrosstabCell) it.next();
        visitCrosstabCell(cell.getContents());
      }
    }
    else
    {
      JRCrosstabCell[][] cells = crosstab.getCells();
      if (cells != null)
      {
        Set cellContents = new HashSet();
        for (int i = 0; i < cells.length; i++)
        {
          for (int j = 0; j < cells[i].length; j++)
          {
            JRCrosstabCell cell = cells[i][j];
            if (cell != null && cell.getContents() != null
                && cellContents.add(cell.getContents()))
            {
              visitCrosstabCell(cell.getContents());
            }
          }
        }
      }
    }
View Full Code Here

      if (crosstab instanceof JRDesignCrosstab)
      {
        List cellsList = ((JRDesignCrosstab) crosstab).getCellsList();
        for (int i = 0; i < cellsList.size(); i++)
        {
          JRCrosstabCell cell = (JRCrosstabCell) cellsList.get(i);
          writeCrosstabCell( cell, crosstabName + "Cell" + i);
          write( crosstabName + ".addCell(" + crosstabName + "Cell" + i + ");\n");
        }
      }
      else
      {
        JRCrosstabCell[][] cells = crosstab.getCells();
        Set cellsSet = new HashSet();
        for (int i = cells.length - 1; i >= 0 ; --i)
        {
          for (int j = cells[i].length - 1; j >= 0 ; --j)
          {
            JRCrosstabCell cell = cells[i][j];
            if (cell != null && cellsSet.add(cell))
            {
              writeCrosstabCell( cell, crosstabName + "Cell" + i + "" + j);
              write( crosstabName + ".addCell(" + crosstabName + "Cell" + i + "" + j + ");\n");
            }
View Full Code Here

    if (crosstab instanceof JRDesignCrosstab)
    {
      List cellsList = ((JRDesignCrosstab) crosstab).getCellsList();
      for (Iterator it = cellsList.iterator(); it.hasNext();)
      {
        JRCrosstabCell cell = (JRCrosstabCell) it.next();
        writeCrosstabCell(cell);
      }
    }
    else
    {
      JRCrosstabCell[][] cells = crosstab.getCells();
      Set cellsSet = new HashSet();
      for (int i = cells.length - 1; i >= 0 ; --i)
      {
        for (int j = cells[i].length - 1; j >= 0 ; --j)
        {
          JRCrosstabCell cell = cells[i][j];
          if (cell != null && cellsSet.add(cell))
          {
            writeCrosstabCell(cell);
          }
        }
View Full Code Here

      if (cellsList != null)
      {
        for (Iterator iter = cellsList.iterator(); iter.hasNext();)
        {
          JRCrosstabCell cell = (JRCrosstabCell) iter.next();
          crosstabCollector.collect(cell.getContents());
        }
      }
    }
    else
    {
View Full Code Here

      if (crosstab instanceof JRDesignCrosstab)
      {
        List cellsList = ((JRDesignCrosstab) crosstab).getCellsList();
        for (Iterator it = cellsList.iterator(); element == null && it.hasNext();)
        {
          JRCrosstabCell cell = (JRCrosstabCell) it.next();
          element = cell.getContents().getElementByKey(key);
        }
      }
      else
      {
        JRCrosstabCell[][] cells = crosstab.getCells();
        for (int i = cells.length - 1; element == null && i >= 0; --i)
        {
          for (int j = cells[i].length - 1; element == null && j >= 0; --j)
          {
            JRCrosstabCell cell = cells[i][j];
            if (cell != null)
            {
              element = cell.getContents().getElementByKey(key);
            }
          }
        }
      }
    }
View Full Code Here

        rowGroupsMap.put(group.getName(), Integer.valueOf(it.previousIndex()));
      }
     
      for (Iterator it = cellsList.iterator(); it.hasNext();)
      {
        JRCrosstabCell cell = (JRCrosstabCell) it.next();
        String rowTotalGroup = cell.getRowTotalGroup();
        if (rowTotalGroup != null && rowTotalGroup.equals(groupName))
        {
          it.remove();
          cellsMap.remove(new Pair(rowTotalGroup, cell.getColumnTotalGroup()));
          getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_CELLS, cell, -1);
        }
      }
     
      removeRowGroupVars(removed);
View Full Code Here

        columnGroupsMap.put(group.getName(), Integer.valueOf(it.previousIndex()));
      }
     
      for (Iterator it = cellsList.iterator(); it.hasNext();)
      {
        JRCrosstabCell cell = (JRCrosstabCell) it.next();
        String columnTotalGroup = cell.getColumnTotalGroup();
        if (columnTotalGroup != null && columnTotalGroup.equals(groupName))
        {
          it.remove();
          cellsMap.remove(new Pair(cell.getRowTotalGroup(), columnTotalGroup));
          getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_CELLS, cell, -1);
        }
      }
     
      removeColGroupVars(removed);
View Full Code Here

   */
  public JRCrosstabCell removeCell(String rowTotalGroup, String columnTotalGroup)
  {
    Object cellKey = new Pair(rowTotalGroup, columnTotalGroup);
   
    JRCrosstabCell cell = (JRCrosstabCell) cellsMap.remove(cellKey);
    if (cell != null)
    {
      cellsList.remove(cell);
      getEventSupport().fireCollectionElementRemovedEvent(PROPERTY_CELLS, cell, -1);
    }
View Full Code Here

  {
    JRCrosstabCell[][] cells = crosstab.getCells();
    JRCrosstabRowGroup[] rowGroups = crosstab.getRowGroups();
    JRCrosstabColumnGroup[] columnGroups = crosstab.getColumnGroups();

    JRCrosstabCell baseCell = cells[rowGroups.length][columnGroups.length];
    if(baseCell == null || baseCell.getWidth() == null)
    {
      addBrokenRule("Crosstab base cell width not specified.", crosstab);
    }

    if(baseCell == null || baseCell.getHeight() == null)
    {
      addBrokenRule("Crosstab base cell height not specified.", crosstab);
    }

    for (int i = rowGroups.length; i >= 0 ; --i)
    {
      for (int j = columnGroups.length; j >= 0 ; --j)
      {
        JRCrosstabCell cell = cells[i][j];

        String cellText = getCrosstabCellText(rowGroups, columnGroups, i, j);

        if (cell != null)
        {
          JRCellContents contents = cell.getContents();

          if (i < rowGroups.length)
          {
            JRCrosstabCell colCell = cells[rowGroups.length][j];
            if (colCell != null && colCell.getContents().getWidth() != contents.getWidth())
            {
              addBrokenRule("Crosstab " + cellText + " width should be " + colCell.getContents().getWidth() + ".", cell);
            }
          }

          if (j < columnGroups.length)
          {
            JRCrosstabCell rowCell = cells[i][columnGroups.length];
            if (rowCell != null && rowCell.getContents().getHeight() != contents.getHeight())
            {
              addBrokenRule("Crosstab " + cellText + " height should be " + rowCell.getContents().getHeight() + ".", cell);
            }
          }

          verifyCellContents(contents, cellText);
        }
View Full Code Here

TOP

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

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.