Examples of JRExporterGridCell


Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

      boolean allowRowResize = false;
      int maxBottomPadding = 0; //for some strange reason, the bottom margin affects the row height; subtracting it here
      for(int col = 0; col < grid[0].length; col++)
      {
        JRExporterGridCell gridCell = grid[row][col];
        JRLineBox box = gridCell.getBox();
        if (
          box != null
          && box.getBottomPadding() != null
          && maxBottomPadding < box.getBottomPadding().intValue()
          )
        {
          maxBottomPadding = box.getBottomPadding().intValue();
        }
       
        allowRowResize =
          flexibleRowHeight
          && (allowRowResize
            || (gridCell.getElement() instanceof JRPrintText
              || (gridCell.getType() == JRExporterGridCell.TYPE_OCCUPIED_CELL
                && ((OccupiedGridCell)gridCell).getOccupier().getElement() instanceof JRPrintText)
              )
            );
      }
      int rowHeight = gridLayout.getRowHeight(row) - maxBottomPadding;
     
      tableHelper.exportRowHeader(
        rowHeight,
        allowRowResize
        );

      for(int col = 0; col < grid[0].length; col++)
      {
        JRExporterGridCell gridCell = grid[row][col];
        if (gridCell.getType() == JRExporterGridCell.TYPE_OCCUPIED_CELL)
        {
          if (emptyCellColSpan > 0)
          {
            //tableHelper.exportEmptyCell(gridCell, emptyCellColSpan);
            emptyCellColSpan = 0;
            emptyCellWidth = 0;
          }

          OccupiedGridCell occupiedGridCell = (OccupiedGridCell)gridCell;
          ElementGridCell elementGridCell = (ElementGridCell)occupiedGridCell.getOccupier();
          tableHelper.exportOccupiedCells(elementGridCell);
          col += elementGridCell.getColSpan() - 1;
        }
        else if(gridCell.getWrapper() != null)
        {
          if (emptyCellColSpan > 0)
          {
            //writeEmptyCell(tableHelper, gridCell, emptyCellColSpan, emptyCellWidth, rowHeight);
            emptyCellColSpan = 0;
            emptyCellWidth = 0;
          }

          element = gridCell.getWrapper().getElement();

          if (element instanceof JRPrintLine)
          {
            exportLine(tableHelper, (JRPrintLine)element, gridCell);
          }
          else if (element instanceof JRPrintRectangle)
          {
            exportRectangle(tableHelper, (JRPrintRectangle)element, gridCell);
          }
          else if (element instanceof JRPrintEllipse)
          {
            exportEllipse(tableHelper, (JRPrintEllipse)element, gridCell);
          }
          else if (element instanceof JRPrintImage)
          {
            exportImage(tableHelper, (JRPrintImage)element, gridCell);
          }
          else if (element instanceof JRPrintText)
          {
            exportText(tableHelper, (JRPrintText)element, gridCell);
          }
          else if (element instanceof JRPrintFrame)
          {
            exportFrame(tableHelper, (JRPrintFrame)element, gridCell);
          }
          else if (element instanceof JRGenericPrintElement)
          {
            exportGenericElement(tableHelper, (JRGenericPrintElement)element, gridCell);
          }

          col += gridCell.getColSpan() - 1;
        }
        else
        {
          emptyCellColSpan++;
          emptyCellWidth += gridCell.getWidth();
          tableHelper.exportEmptyCell(gridCell, 1);
        }
      }

//      if (emptyCellColSpan > 0)
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    int rowIndex
    ) throws JRException
  {
    JRXlsxExporter exporter = (JRXlsxExporter)exporterContext.getExporter();
   
    JRExporterGridCell newGridCell = getGridCellReplacement(exporterContext, element, gridCell);
   
    exporter.exportText((JRPrintText)newGridCell.getElement(), newGridCell, colIndex, rowIndex);
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    JRExporterGridCell gridCell
    )
  {
    JRDocxExporter exporter = (JRDocxExporter)exporterContext.getExporter();
   
    JRExporterGridCell newGridCell = getGridCellReplacement(exporterContext, element, gridCell);
   
    exporter.exportText(exporterContext.getTableHelper(), (JRPrintText)newGridCell.getElement(), newGridCell);
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    JRExporterGridCell gridCell
    )
  {
    JROdsExporter exporter = (JROdsExporter)exporterContext.getExporter();
   
    JRExporterGridCell newGridCell = getGridCellReplacement(exporterContext, element, gridCell);
   
    try
    {
      exporter.exportText(exporterContext.getTableBuilder(), (JRPrintText)newGridCell.getElement(), newGridCell);
    }
    catch (IOException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    JRExporterGridCell gridCell
    )
  {
    JRPrintText text = getTextElementReplacement(exporterContext, element);

    JRExporterGridCell newGridCell =
      new ElementGridCell(
        new ElementWrapper(null, text, null),
        gridCell.getWidth(),
        gridCell.getHeight(),
        gridCell.getColSpan(),
        gridCell.getRowSpan()
        );
   
    newGridCell.setBox(text.getLineBox());
   
    return newGridCell;
  }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    JRGridLayout layout
    )
  {
    JRXlsExporter exporter = (JRXlsExporter)exporterContext.getExporter();
   
    JRExporterGridCell newGridCell = getGridCellReplacement(exporterContext, element, gridCell);
   
    try
    {
      exporter.exportText((JRPrintText)newGridCell.getElement(), newGridCell, colIndex, rowIndex);
    }
    catch (JRException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    JRGridLayout layout
    )
  {
    JExcelApiExporter exporter = (JExcelApiExporter)exporterContext.getExporter();
   
    JRExporterGridCell newGridCell = getGridCellReplacement(exporterContext, element, gridCell);
   
    try
    {
      exporter.exportText((JRPrintText)newGridCell.getElement(), newGridCell, colIndex, rowIndex);
    }
    catch (JRException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

    JRExporterGridCell gridCell
    )
  {
    JROdtExporter exporter = (JROdtExporter)exporterContext.getExporter();
   
    JRExporterGridCell newGridCell = getGridCellReplacement(exporterContext, element, gridCell);
   
    try
    {
      exporter.exportText(exporterContext.getTableBuilder(), (JRPrintText)newGridCell.getElement(), newGridCell);
    }
    catch (IOException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here

Examples of net.sf.jasperreports.engine.export.JRExporterGridCell

      tableBuilder.buildRowStyle(row, rowHeight);
      tableBuilder.buildRowHeader(row);

      for(int col = 0; col < grid[0].length; col++)
      {
        JRExporterGridCell gridCell = grid[row][col];
        if (gridCell.getType() == JRExporterGridCell.TYPE_OCCUPIED_CELL)
        {
          if (emptyCellColSpan > 0)
          {
            //writeEmptyCell(gridCell, emptyCellColSpan, emptyCellWidth, rowHeight);
            emptyCellColSpan = 0;
            emptyCellWidth = 0;
          }

          //writeOccupiedCells(1);
          exportOccupiedCells(1);
//          OccupiedGridCell occupiedGridCell = (OccupiedGridCell)gridCell;
//          ElementGridCell elementGridCell = (ElementGridCell)grid[occupiedGridCell.getRow()][occupiedGridCell.getCol()];
//          exportOccupiedCells(elementGridCell);
//          col += elementGridCell.getColSpan() - 1;
        }
        else if(gridCell.getWrapper() != null)
        {
          if (emptyCellColSpan > 0)
          {
            //writeEmptyCell(gridCell, emptyCellColSpan, emptyCellWidth, rowHeight);
            emptyCellColSpan = 0;
            emptyCellWidth = 0;
          }

          element = gridCell.getWrapper().getElement();

          if (element instanceof JRPrintLine)
          {
            exportLine(tableBuilder, (JRPrintLine)element, gridCell);
          }
          else if (element instanceof JRPrintRectangle)
          {
            exportRectangle(tableBuilder, (JRPrintRectangle)element, gridCell);
          }
          else if (element instanceof JRPrintEllipse)
          {
            exportEllipse(tableBuilder, (JRPrintEllipse)element, gridCell);
          }
          else if (element instanceof JRPrintImage)
          {
            exportImage(tableBuilder, (JRPrintImage)element, gridCell);
          }
          else if (element instanceof JRPrintText)
          {
            exportText(tableBuilder, (JRPrintText)element, gridCell);
          }
          else if (element instanceof JRPrintFrame)
          {
            exportFrame(tableBuilder, (JRPrintFrame)element, gridCell);
          }
          else if (element instanceof JRGenericPrintElement)
          {
            exportGenericElement(tableBuilder, (JRGenericPrintElement)element, gridCell);
          }

          // //x += gridCell.colSpan - 1;
          //col += gridCell.getColSpan() - 1;
        }
        else
        {
          emptyCellColSpan++;
          emptyCellWidth += gridCell.getWidth();
          exportEmptyCell(gridCell, 1);
        }
      }

//      if (emptyCellColSpan > 0)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.