Class PivotTableDataExcelHelper

java.lang.Object
io.jmix.pivottableflowui.export.PivotTableDataExcelHelper

public class PivotTableDataExcelHelper extends Object
Helps to convert PivotDataRow to list with separated cells and provides methods for merging cells.
  • Field Details

  • Constructor Details

    • PivotTableDataExcelHelper

      public PivotTableDataExcelHelper(PivotData pivotData)
  • Method Details

    • initRows

      protected void initRows()
    • getRows

      public List<List<PivotDataSeparatedCell>> getRows()
      Returns:
      pivot table data with separated cells (all merged cells were separated and each separated cell has common value and id)
    • getOriginColumnsNumber

      public int getOriginColumnsNumber()
      Returns:
      number of exactly excel columns and -1 if there is no columns
    • getCellIdsToMerged

      public List<String> getCellIdsToMerged()
      Returns:
      list with unique cells id which should be merged
    • getFirstRowById

      public int getFirstRowById(String id)
      Parameters:
      id - PivotDataSeparatedCell id that should be merged
      Returns:
      first row index of all cells that should be merged by common id
    • getLastRowById

      public int getLastRowById(String id)
      Parameters:
      id - PivotDataSeparatedCell id that should be merged
      Returns:
      last row index of all cells that should be merged by common id
    • getFirstColById

      public int getFirstColById(String id)
      Parameters:
      id - PivotDataSeparatedCell id that should be merged
      Returns:
      first col index of all cells that should be merged by common id
    • getLastColById

      public int getLastColById(String id)
      Parameters:
      id - PivotDataSeparatedCell id that should be merged
      Returns:
      last col index of all cells that should be merged by common id
    • getCellRangeAddresses

      public List<org.apache.poi.ss.util.CellRangeAddress> getCellRangeAddresses()
      Returns:
      a collection of cell range addresses that should be merged in the HSSFSheet
    • createRow

      protected List<PivotDataSeparatedCell> createRow(PivotDataRow currentRow, @Nullable List<PivotDataSeparatedCell> prevRow)
    • addAboveCell

      protected boolean addAboveCell(PivotDataSeparatedCell aboveCell, int indexRow)
    • createAndAddSeparatedCells

      protected int createAndAddSeparatedCells(PivotDataSeparatedCell separatedCell, List<PivotDataSeparatedCell> cellsRow)
    • convertPivotCellToSeparatedCell

      protected PivotDataSeparatedCell convertPivotCellToSeparatedCell(PivotDataCell pivotDataCell)