JIDE 3.5.15

com.jidesoft.hssf
Class HssfTableUtils

java.lang.Object
  extended by com.jidesoft.hssf.HssfTableUtils
Direct Known Subclasses:
HssfPivotTableUtils, HssfTableScrollPaneUtils

public class HssfTableUtils
extends Object

HssfTableUtils is a class that has methods to export any JTable's content to Excel (.xls) file format using HSSF-POI. You can find more information about HSSF-POI at http://poi.apache.org/spreadsheet/index.html.

The export feature will not consider the cell contents conversion but you can use CellValueConverter to format the value if you want. It also supports cell span if the table model is SpanModel. It will also optionally consider table header as part of the export. Cell style is also supported as far as the Excel format allows.

Please set the client property CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT for the target JTable before you invoke this method so that you can choose the output format. If you didn't set the client property, we will use office2003 format for backward compatibility concern.

Please be noted that, if you use office2003 format, there is a limitation that the row count cannot exceed 65536. Although office2007 format looks solve the issue, it will consume extremely high memory which in most case is not realistic. So in general, we currently have limitation that the row count cannot exceed 65536.


Nested Class Summary
static interface HssfTableUtils.CellValueConverter
          Converts the cell value in a table to the value that will be written to Excel cell.
static class HssfTableUtils.ContextSensitiveCellValueConverter
          Converts the cell value in a table to the value that will be written to Excel cell.
static class HssfTableUtils.DefaultCellValueConverter
          Converts the cell value in a table to the value that will be written to Excel cell.
static interface HssfTableUtils.POICustomizer
          The POI customizer class which will be invoked after JIDE finish every settings for the cell.
 
Field Summary
static String CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT
          The format for the component to export to excel.
static String CLIENT_PROPERTY_FLUSH_ROWS
          The maximum rows to flush memory when exporting to EXCEL_OUTPUT_FORMAT_2007 and CLIENT_PROPERTY_USE_SXSSF_WORKBOOK is true.
static String CLIENT_PROPERTY_USE_SXSSF_WORKBOOK
          The property to use SXSSFWorkbook when exporting to EXCEL_OUTPUT_FORMAT_2007.
static String EXCEL_OUTPUT_FORMAT_2003
          A value for CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT to support format on Microsoft Office 2003 and earlier versions.
static String EXCEL_OUTPUT_FORMAT_2007
          A value for CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT to support format on Microsoft Office 2007 and later versions.
 
Constructor Summary
HssfTableUtils()
           
 
Method Summary
static boolean export(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String fileName, String sheetName, boolean append, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Exports the table to an Excel file.
static boolean export(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String fileName, String sheetName, boolean append, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter)
          Exports the table to an Excel file.
static boolean export(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String fileName, String sheetName, boolean append, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter, HssfTableUtils.POICustomizer customizer)
          Exports the table to an Excel file.
static boolean export(JTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter)
          Exports the table to as Excel file output steam.
static boolean export(JTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter)
          Exports the table to as Excel file output steam.
static boolean export(JTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter, HssfTableUtils.POICustomizer customizer)
          Exports the table to as Excel file output steam.
static boolean export(JTable table, OutputStream out, String sheetName)
          Exports the table to as Excel file output steam.
static boolean export(JTable table, OutputStream out, String sheetName, boolean includeTableHeader)
          Exports the table to as Excel file output steam.
static boolean export(JTable table, OutputStream out, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Exports the table to as Excel file output steam.
static boolean export(JTable table, String fileName, String sheetName, boolean append)
          Exports the table to an Excel file.
static boolean export(JTable table, String fileName, String sheetName, boolean append, boolean includeTableHeader)
          Exports the table to an Excel file.
static boolean export(JTable table, String fileName, String sheetName, boolean append, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Exports the table to an Excel file.
static void exportToCell(Sheet sheet, int rowIndex, int columnIndex, Object value)
          Exports a value to a particular cell in the sheet.
static void exportToSheet(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter, HssfTableUtils.POICustomizer customizer)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, Workbook wb, Sheet sheet, HssfTableFormat format)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, Workbook wb, Sheet sheet, int startRow, int startColumn)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter, StringConverter columnNameConverter)
          Exports the table to the specified location of an Excel sheet.
static void exportToSheet(JTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, HssfTableUtils.CellValueConverter converter)
          Exports the table to the specified location of an Excel sheet.
static boolean isHssfInstalled()
          Check if poi.jar is in the classpath.
static boolean isXssfInstalled()
          Check if poi.jar is in the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT

public static final String CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT
The format for the component to export to excel. There are two formats defined.

See Also:
EXCEL_OUTPUT_FORMAT_2003, EXCEL_OUTPUT_FORMAT_2007, Constant Field Values

CLIENT_PROPERTY_USE_SXSSF_WORKBOOK

public static final String CLIENT_PROPERTY_USE_SXSSF_WORKBOOK
The property to use SXSSFWorkbook when exporting to EXCEL_OUTPUT_FORMAT_2007.

By default, XSSFWorkbook will be used to get maximum function. However, this default mode will consume many memory. If you have a really huge table to export, please consider set this property to true. The trade-off is that no spanning and grouping information will be exported to the excel file.

Since:
3.4.9
See Also:
Constant Field Values

CLIENT_PROPERTY_FLUSH_ROWS

public static final String CLIENT_PROPERTY_FLUSH_ROWS
The maximum rows to flush memory when exporting to EXCEL_OUTPUT_FORMAT_2007 and CLIENT_PROPERTY_USE_SXSSF_WORKBOOK is true.

Since:
3.4.9
See Also:
Constant Field Values

EXCEL_OUTPUT_FORMAT_2003

public static final String EXCEL_OUTPUT_FORMAT_2003
A value for CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT to support format on Microsoft Office 2003 and earlier versions.

See Also:
Constant Field Values

EXCEL_OUTPUT_FORMAT_2007

public static final String EXCEL_OUTPUT_FORMAT_2007
A value for CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT to support format on Microsoft Office 2007 and later versions.

See Also:
Constant Field Values
Constructor Detail

HssfTableUtils

public HssfTableUtils()
Method Detail

isHssfInstalled

public static boolean isHssfInstalled()
Check if poi.jar is in the classpath. All export methods in this util called this method first before continuing.

Returns:
true if poi.jar is in the classpath. Otherwise false.

isXssfInstalled

public static boolean isXssfInstalled()
Check if poi.jar is in the classpath. All export methods in this util called this method first before continuing.

Returns:
true if poi.jar is in the classpath. Otherwise false.

export

public static boolean export(JTable table,
                             String fileName,
                             String sheetName,
                             boolean append)
                      throws IOException
Exports the table to an Excel file.

Parameters:
table - the table to be exported.
fileName - the Excel file name. It should be the full path to the file.
sheetName - the worksheet name.
append - whether it appends to the existing Excel file or it creates a new Excel file.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader)
                      throws IOException
Exports the table to an Excel file.

Parameters:
table - the table to be exported.
fileName - the Excel file name. It should be the full path to the file.
sheetName - the worksheet name.
append - whether it appends to the existing Excel file or it creates a new Excel file.
includeTableHeader - whether to include the table header.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Exports the table to an Excel file.

Parameters:
table - the table to be exported.
fileName - the Excel file name. It should be the full path to the file.
sheetName - the worksheet name.
append - whether it appends to the existing Excel file or it creates a new Excel file.
includeTableHeader - whether to include the table header.
converter - the converter to convert cell value to the value that can be set to Excel cell.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Exports the table to an Excel file.

Parameters:
table - the table to be exported.
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
fileName - the Excel file name. It should be the full path to the file.
sheetName - the worksheet name.
append - whether it appends to the existing Excel file or it creates a new Excel file.
includeTableHeader - whether to include the table header.
converter - the converter to convert cell value to the value that can be set to Excel cell.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter)
                      throws IOException
Exports the table to an Excel file.

Parameters:
table - the table to be exported.
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
fileName - the Excel file name. It should be the full path to the file.
sheetName - the worksheet name.
append - whether it appends to the existing Excel file or it creates a new Excel file.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.
columnNameConverter - the converter to convert the column name.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter,
                             HssfTableUtils.POICustomizer customizer)
                      throws IOException
Exports the table to an Excel file.

Parameters:
table - the table to be exported.
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
fileName - the Excel file name. It should be the full path to the file.
sheetName - the worksheet name.
append - whether it appends to the existing Excel file or it creates a new Excel file.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.
columnNameConverter - the converter to convert the column name.
customizer - the customizer to customize a POI cell and the entire sheet.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             OutputStream out,
                             String sheetName)
                      throws IOException
Exports the table to as Excel file output steam.

Parameters:
table - the table to be exported.
out - the output stream
sheetName - the worksheet name.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             OutputStream out,
                             String sheetName,
                             boolean includeTableHeader)
                      throws IOException
Exports the table to as Excel file output steam.

Parameters:
table - the table to be exported.
out - the output stream
sheetName - the worksheet name.
includeTableHeader - whether to include the table header.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             OutputStream out,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Exports the table to as Excel file output steam.

Parameters:
table - the table to be exported.
out - the output stream
sheetName - the worksheet name.
includeTableHeader - whether to include the table header.
converter - the converter to convert cell value to the value that can be set to Excel cell.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             OutputStream out,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter)
                      throws IOException
Exports the table to as Excel file output steam.

Parameters:
table - the table to be exported.
out - the output stream
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
sheetName - the worksheet name.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             OutputStream out,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter)
                      throws IOException
Exports the table to as Excel file output steam.

Parameters:
table - the table to be exported.
out - the output stream
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
sheetName - the worksheet name.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.
columnNameConverter - the converter to convert the column name.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

export

public static boolean export(JTable table,
                             OutputStream out,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter,
                             HssfTableUtils.POICustomizer customizer)
                      throws IOException
Exports the table to as Excel file output steam.

Parameters:
table - the table to be exported.
out - the output stream
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
sheetName - the worksheet name.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.
columnNameConverter - the converter to convert the column name.
customizer - the customizer to customize a POI cell and the entire sheet.
Returns:
true if exporting succeed. If poi.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if the write to the file failed.
FileNotFoundException - if the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason

exportToSheet

public static void exportToSheet(JTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.

exportToSheet

public static void exportToSheet(JTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 HssfTableUtils.CellValueConverter converter)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.
converter - the converter to convert cell value to the value that can be set to Excel cell.

exportToSheet

public static void exportToSheet(JTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.
includeTableHeader - whether to include the table header.

exportToSheet

public static void exportToSheet(JTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter converter)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.
includeTableHeader - whether to include the table header.
converter - the converter to convert cell value to the value that can be set to Excel cell.

exportToSheet

public static void exportToSheet(JTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter converter,
                                 StringConverter columnNameConverter)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.
includeTableHeader - whether to include the table header.
converter - the converter to convert cell value to the value that can be set to Excel cell.
columnNameConverter - the converter to convert the column name.

exportToSheet

public static void exportToSheet(JTable table,
                                 int firstRow,
                                 int firstColumn,
                                 int numberOfRows,
                                 int numberOfColumns,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter cellValueConverter)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.

exportToSheet

public static void exportToSheet(JTable table,
                                 int firstRow,
                                 int firstColumn,
                                 int numberOfRows,
                                 int numberOfColumns,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter cellValueConverter,
                                 StringConverter columnNameConverter,
                                 HssfTableUtils.POICustomizer customizer)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
firstRow - the first row to be exported
firstColumn - the first row to be exported
numberOfRows - number of rows to be exported, -1 means all rows.
numberOfColumns - number of columns to be exported. -1 means all columns.
wb - the Workbook
sheet - the worksheet
startRow - the starting row. The first cell of the table will appear at this row index.
startColumn - the starting column. The first cell of the table will appear at this row index.
includeTableHeader - whether to include the table header.
cellValueConverter - the converter to convert cell value to the value that can be set to Excel cell.
columnNameConverter - the converter to convert the column name.
customizer - the customizer to customize a POI cell, the POI row and the entire sheet.

exportToSheet

public static void exportToSheet(JTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 HssfTableFormat format)
Exports the table to the specified location of an Excel sheet.

Parameters:
table - the table to be exported.
wb - the Workbook
sheet - the worksheet
format - HssfTableFormat instance which stores every single information needed for exporting to sheet

exportToCell

public static void exportToCell(Sheet sheet,
                                int rowIndex,
                                int columnIndex,
                                Object value)
Exports a value to a particular cell in the sheet.

Parameters:
sheet - the worksheet
rowIndex - the row index of the cell
columnIndex - the column index of the cell
value - the value

JIDE 3.5.15