Package net.sf.jasperreports.crosstabs.fill.calculation

Examples of net.sf.jasperreports.crosstabs.fill.calculation.HeaderCell


        {
          int size = width ? fillHeader.getWidth() : fillHeader.getHeight();
         
          for (int i = 0; i < headersData[0].length; i++)
          {
            HeaderCell header = headersData[j][i];
            if (header != null && !header.isTotal() && header.getLevelSpan() > 1)
            {
              int span = header.getLevelSpan();
             
              if (startHeaders)
              {
                for (int k = i + 1; k < i + span && offsets[k] - offsets[i] < size; ++k)
                {
View Full Code Here


      int[] counts = new int[headersData[0].length];
     
      HeaderCell[] lastHeaders = headersData[headersData.length - 1];
      for (int i = 0, c = 0; i < counts.length; ++i)
      {
        HeaderCell lastHeader = lastHeaders[i];
        if (lastHeader != null && !lastHeader.isTotal())
        {
          ++c;
        }
       
        counts[i] = c;
View Full Code Here

        {
          HeaderCell[] firstHeaders = (HeaderCell[]) headers.get(0);

          for (int j = 0; j < groups.length; ++j)
          {
            HeaderCell header = headersData[j][firstIndex];

            if (header == null)
            {
              int spanIndex = getSpanIndex(firstIndex, j, headersData);
              if (spanIndex >= 0)
              {
                HeaderCell spanCell = headersData[j][spanIndex];
                int headerEndIdx = spanCell.getLevelSpan() + spanIndex;
                if (headerEndIdx > lastIndex)
                {
                  headerEndIdx = lastIndex;
                }
                firstHeaders[j] = HeaderCell.createLevelSpanCopy(spanCell, headerEndIdx - firstIndex);
              }
            }
          }
        }

        if (lastIndex < headersData[0].length)
        {
          for (int j = 0; j < groups.length; ++j)
          {
            HeaderCell header = headersData[j][lastIndex];

            if (header == null)
            {
              int spanIndex = getSpanIndex(lastIndex, j, headersData);
              if (spanIndex >= firstIndex)
              {
                HeaderCell spanCell = headersData[j][spanIndex];
                HeaderCell[] headerCells = (HeaderCell[]) headers.get(spanIndex - firstIndex);
                headerCells[j] = HeaderCell.createLevelSpanCopy(spanCell, lastIndex - spanIndex);
              }
            }
          }
View Full Code Here

        --spanIndex;
      }

      if (spanIndex >= 0)
      {
        HeaderCell spanCell = headersData[j][spanIndex];
        int span = spanCell.getLevelSpan();

        if (span > i - spanIndex)
        {
          return spanIndex;
        }
View Full Code Here

      for (rowIdx = 0; rowIdx < columnGroups.length; rowIdx++)
      {
        for (int columnIdx = startColumnIndex; columnIdx < lastColumnIndex; ++columnIdx)
        {
          HeaderCell[] headers = (HeaderCell[]) columnHeaders.get(columnIdx - startColumnIndex);
          HeaderCell cell = headers[rowIdx];
         
          if (cell != null)
          {
            JRFillCellContents contents = prepareColumnHeader(cell, columnIdx, rowHeadersXOffset, availableHeight);
            columnHeaderRows[rowIdx + cell.getDepthSpan() - 1][columnIdx - startColumnIndex + 1] = contents;
           
            if (willOverflow)
            {
              break rows;
            }
View Full Code Here

     
      if (printRowHeaders)
      {
        for (int j = 0; j < rowGroups.length; j++)
        {
          HeaderCell cell = rowHeadersData[j][rowIdx + startRowIndex];
          int vSpan = 0;
          if (cell == null)
          {
            // if we have a span header
            if (toCloseRowHeader(j))
            {
              cell = spanHeaders[j];
              vSpan = cell.getLevelSpan();
              if (spanHeadersStart[j] < startRowIndex)//continuing from the prev page
              {
                vSpan += spanHeadersStart[j] - startRowIndex;
              }
            }
          }
          else
          {
            if (cell.getLevelSpan() > 1)
            {
              spanHeaders[j] = cell;
              spanHeadersStart[j] = rowIdx + startRowIndex;
              continue;
            }
View Full Code Here

      ++rowIdx;
    }

    private boolean prepareContinuingRowHeader(int rowGroup, int availableHeight) throws JRException
    {
      HeaderCell cell = spanHeaders[rowGroup];
      int vSpan = rowIdx + startRowIndex - spanHeadersStart[rowGroup];

      if (spanHeadersStart[rowGroup] < startRowIndex)//continuing from the prev page
      {
        vSpan += spanHeadersStart[rowGroup] - startRowIndex;
      }

      int headerY = ((Integer) rowYs.get(rowIdx - vSpan)).intValue();
      int lastHeaderY = ((Integer) rowYs.get(rowIdx)).intValue();
      int headerHeight = lastHeaderY - headerY;
      int nextToLastHeaderY = ((Integer) rowYs.get(rowIdx - 1)).intValue();
      int stretchHeight = nextToLastHeaderY - headerY;
     
      JRFillCrosstabRowGroup group = rowGroups[rowGroup];
      JRFillCellContents contents = cell.isTotal() ? group.getFillTotalHeader() : group.getFillHeader();
     
      boolean stretchContents = group.getPositionValue() == CrosstabRowPositionEnum.STRETCH;
      int contentsHeight = stretchContents ? headerHeight : contents.getHeight();
     
      boolean headerOverflow = availableHeight < headerY + contentsHeight || headerHeight < contents.getHeight();
      if (!headerOverflow)
      {
        setCountVars(rowIdx + startRowIndex - vSpan, -1);
        setGroupVariables(rowGroups, cell.getBucketValues());

        if (stretchContents)
        {
          contents = contents.getTransformedContents(contents.getWidth(), headerHeight, CrosstabColumnPositionEnum.LEFT, CrosstabRowPositionEnum.STRETCH);
        }
       
        contents = contents.getBoxContents(false, false, rowIdx == vSpan && (!printColumnHeaders || headerCell == null));
        contents.getWorkingClone();

        contents.evaluate(JRExpression.EVALUATION_DEFAULT);
        contents.prepare(availableHeight - headerY);
       
        preparedRow.add(contents);

        headerOverflow = contents.willOverflow();

        if (!headerOverflow)
        {
          contents.setX(rowHeadersXOffsets[rowGroup]);
          contents.setY(headerY + yOffset);
          contents.setVerticalSpan(vSpan);
          contents.setHorizontalSpan(cell.getDepthSpan());
         
          int rowHeight = contents.getPrintHeight() - stretchHeight;
          if (rowHeight > preparedRowHeight)
          {
            preparedRowHeight = rowHeight;
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.crosstabs.fill.calculation.HeaderCell

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.