Class PoiExcelHelper


  • public final class PoiExcelHelper
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.poi.ss.usermodel.Font cloneFontFrom​(org.apache.poi.ss.usermodel.Cell cell)  
      static org.apache.poi.ss.usermodel.CellStyle cloneStyleFrom​(org.apache.poi.ss.usermodel.Cell cell)  
      static void copyCellStyle​(org.apache.poi.ss.usermodel.Cell cellFrom, org.apache.poi.ss.usermodel.Cell cellTo, org.apache.poi.ss.usermodel.Sheet sheetTo)  
      static void copyCellValue​(org.apache.poi.ss.usermodel.Cell cellFrom, org.apache.poi.ss.usermodel.Cell cellTo)  
      static <T extends org.apache.poi.ss.usermodel.CellStyle>
      T
      createCellStyle​(org.apache.poi.ss.usermodel.Workbook workbook)  
      static void evaluateFormula​(org.apache.poi.ss.usermodel.Cell cell)
      Evaluates formula in the cell to get new cell value.
      static org.apache.poi.ss.usermodel.Cell getCell​(int colIndex, int rowIndex, org.apache.poi.ss.usermodel.Sheet sheet)  
      static short[][] getCellBorderColors​(org.apache.poi.ss.usermodel.CellStyle style, org.apache.poi.ss.usermodel.Workbook workbook)  
      static org.apache.poi.ss.usermodel.BorderStyle[] getCellBorderStyles​(org.apache.poi.ss.usermodel.CellStyle style)  
      static org.apache.poi.ss.usermodel.Font getCellFont​(org.apache.poi.ss.usermodel.Cell cell)  
      static org.apache.poi.xssf.usermodel.XSSFColor getColor​(short[] color, org.apache.poi.xssf.usermodel.XSSFWorkbook workbook)  
      static int getColumnWidth​(int col, org.apache.poi.ss.usermodel.Sheet sheet)
      Some magic numbers here What is column width???
      static short[] getFontColor​(org.apache.poi.ss.usermodel.Font font, org.apache.poi.ss.usermodel.Workbook workbook)  
      static int getLastRowNum​(org.apache.poi.ss.usermodel.Sheet sheet)  
      static int getMaxColumnIndex​(int rownum, org.apache.poi.ss.usermodel.Sheet sheet)
      Returns the index of the column.
      static int getMaxRowIndex​(org.apache.poi.ss.usermodel.Sheet sheet)  
      static org.apache.poi.ss.util.CellRangeAddress getMergedRegionAt​(int index, org.apache.poi.ss.usermodel.Sheet sheet)  
      static int getMinColumnIndex​(int rownum, org.apache.poi.ss.usermodel.Sheet sheet)
      Returns the index of the column, the next column will be the first cell with data in given row.
      static int getMinRowIndex​(org.apache.poi.ss.usermodel.Sheet sheet)  
      static int getNumberOfMergedRegions​(org.apache.poi.ss.usermodel.Sheet sheet)  
      static org.apache.poi.ss.usermodel.Cell getOrCreateCell​(int colIndex, int rowIndex, org.apache.poi.ss.usermodel.Sheet sheet)  
      static void setCellBorderColors​(org.apache.poi.ss.usermodel.CellStyle style, short[][] colors, org.apache.poi.ss.usermodel.Workbook workbook)  
      static void setCellFont​(org.apache.poi.ss.usermodel.Cell cell, boolean boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline)  
      static void setCellFontBold​(org.apache.poi.ss.usermodel.Cell cell, boolean boldweight)  
      static void setCellFontItalic​(org.apache.poi.ss.usermodel.Cell cell, boolean italic)  
      static void setCellFontUnderline​(org.apache.poi.ss.usermodel.Cell cell, byte underline)  
      static void setCellStringValue​(int col, int row, String value, org.apache.poi.ss.usermodel.Sheet sheet)  
      static short[] toRgb​(short colorIndex, org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)  
      static short[] toRgb​(org.apache.poi.ss.usermodel.Color color)  
    • Method Detail

      • copyCellValue

        public static void copyCellValue​(org.apache.poi.ss.usermodel.Cell cellFrom,
                                         org.apache.poi.ss.usermodel.Cell cellTo)
      • copyCellStyle

        public static void copyCellStyle​(org.apache.poi.ss.usermodel.Cell cellFrom,
                                         org.apache.poi.ss.usermodel.Cell cellTo,
                                         org.apache.poi.ss.usermodel.Sheet sheetTo)
      • getCell

        public static org.apache.poi.ss.usermodel.Cell getCell​(int colIndex,
                                                               int rowIndex,
                                                               org.apache.poi.ss.usermodel.Sheet sheet)
      • getOrCreateCell

        public static org.apache.poi.ss.usermodel.Cell getOrCreateCell​(int colIndex,
                                                                       int rowIndex,
                                                                       org.apache.poi.ss.usermodel.Sheet sheet)
      • getColumnWidth

        public static int getColumnWidth​(int col,
                                         org.apache.poi.ss.usermodel.Sheet sheet)
        Some magic numbers here What is column width???
      • getMaxColumnIndex

        public static int getMaxColumnIndex​(int rownum,
                                            org.apache.poi.ss.usermodel.Sheet sheet)
        Returns the index of the column. After that column there is no more filled cells on the sheet in given row.
        Parameters:
        rownum - index of the row on the sheet
      • getMaxRowIndex

        public static int getMaxRowIndex​(org.apache.poi.ss.usermodel.Sheet sheet)
      • getMinColumnIndex

        public static int getMinColumnIndex​(int rownum,
                                            org.apache.poi.ss.usermodel.Sheet sheet)
        Returns the index of the column, the next column will be the first cell with data in given row.
      • getNumberOfMergedRegions

        public static int getNumberOfMergedRegions​(org.apache.poi.ss.usermodel.Sheet sheet)
      • getMinRowIndex

        public static int getMinRowIndex​(org.apache.poi.ss.usermodel.Sheet sheet)
      • getLastRowNum

        public static int getLastRowNum​(org.apache.poi.ss.usermodel.Sheet sheet)
      • setCellStringValue

        public static void setCellStringValue​(int col,
                                              int row,
                                              String value,
                                              org.apache.poi.ss.usermodel.Sheet sheet)
      • getMergedRegionAt

        public static org.apache.poi.ss.util.CellRangeAddress getMergedRegionAt​(int index,
                                                                                org.apache.poi.ss.usermodel.Sheet sheet)
      • evaluateFormula

        public static void evaluateFormula​(org.apache.poi.ss.usermodel.Cell cell)
        Evaluates formula in the cell to get new cell value.
      • createCellStyle

        public static <T extends org.apache.poi.ss.usermodel.CellStyle> T createCellStyle​(org.apache.poi.ss.usermodel.Workbook workbook)
      • cloneStyleFrom

        public static org.apache.poi.ss.usermodel.CellStyle cloneStyleFrom​(org.apache.poi.ss.usermodel.Cell cell)
      • cloneFontFrom

        public static org.apache.poi.ss.usermodel.Font cloneFontFrom​(org.apache.poi.ss.usermodel.Cell cell)
      • getCellFont

        public static org.apache.poi.ss.usermodel.Font getCellFont​(org.apache.poi.ss.usermodel.Cell cell)
      • setCellFont

        public static void setCellFont​(org.apache.poi.ss.usermodel.Cell cell,
                                       boolean boldWeight,
                                       short color,
                                       short fontHeight,
                                       String name,
                                       boolean italic,
                                       boolean strikeout,
                                       short typeOffset,
                                       byte underline)
      • setCellFontBold

        public static void setCellFontBold​(org.apache.poi.ss.usermodel.Cell cell,
                                           boolean boldweight)
      • setCellFontItalic

        public static void setCellFontItalic​(org.apache.poi.ss.usermodel.Cell cell,
                                             boolean italic)
      • setCellFontUnderline

        public static void setCellFontUnderline​(org.apache.poi.ss.usermodel.Cell cell,
                                                byte underline)
      • toRgb

        public static short[] toRgb​(org.apache.poi.ss.usermodel.Color color)
      • toRgb

        public static short[] toRgb​(short colorIndex,
                                    org.apache.poi.hssf.usermodel.HSSFWorkbook workbook)
      • getFontColor

        public static short[] getFontColor​(org.apache.poi.ss.usermodel.Font font,
                                           org.apache.poi.ss.usermodel.Workbook workbook)
      • getCellBorderColors

        public static short[][] getCellBorderColors​(org.apache.poi.ss.usermodel.CellStyle style,
                                                    org.apache.poi.ss.usermodel.Workbook workbook)
      • getCellBorderStyles

        public static org.apache.poi.ss.usermodel.BorderStyle[] getCellBorderStyles​(org.apache.poi.ss.usermodel.CellStyle style)
      • setCellBorderColors

        public static void setCellBorderColors​(org.apache.poi.ss.usermodel.CellStyle style,
                                               short[][] colors,
                                               org.apache.poi.ss.usermodel.Workbook workbook)
      • getColor

        public static org.apache.poi.xssf.usermodel.XSSFColor getColor​(short[] color,
                                                                       org.apache.poi.xssf.usermodel.XSSFWorkbook workbook)