JIDE 3.5.15

com.jidesoft.hssf
Class HssfAggregateTableUtils

java.lang.Object
  extended by com.jidesoft.hssf.HssfAggregateTableUtils
Direct Known Subclasses:
HssfAggregateTablePaneUtils

Deprecated. replaced by HssfTableUtils

@Deprecated
public class HssfAggregateTableUtils
extends Object

HssfAggregateTableUtils is a class that has methods to export any AggregateTable's content to Excel file format using POI. You can find more information about 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 HssfTableUtils.CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT for the target AggregateTable 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.


Constructor Summary
HssfAggregateTableUtils()
          Deprecated.  
 
Method Summary
static boolean export(AggregateTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String fileName, String sheetName, boolean append, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Deprecated. Exports the AggregateTable to an Excel file.
static boolean export(AggregateTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter)
          Deprecated. Exports the AggregateTable to as Excel file output steam.
static boolean export(AggregateTable table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter)
          Deprecated. Exports the AggregateTable to as Excel file output steam.
static boolean export(AggregateTable table, OutputStream out, String sheetName)
          Deprecated. Exports the AggregateTable to as Excel file output steam.
static boolean export(AggregateTable table, OutputStream out, String sheetName, boolean includeTableHeader)
          Deprecated. Exports the AggregateTable to as Excel file output steam.
static boolean export(AggregateTable table, OutputStream out, String sheetName, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Deprecated. Exports the AggregateTable to as Excel file output steam.
static boolean export(AggregateTable table, String fileName, String sheetName, boolean append)
          Deprecated. Exports the AggregateTable to an Excel file.
static boolean export(AggregateTable table, String fileName, String sheetName, boolean append, boolean includeTableHeader)
          Deprecated. Exports the AggregateTable to an Excel file.
static boolean export(AggregateTable table, String fileName, String sheetName, boolean append, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Deprecated. Exports the AggregateTable to an Excel file.
static void exportToCell(Sheet sheet, int rowIndex, int columnIndex, Object value)
          Deprecated. Exports a value to a particular cell in the sheet.
static void exportToSheet(AggregateTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, Workbook wb, Sheet sheet, HssfTableFormat format)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, Workbook wb, Sheet sheet, int startRow, int startColumn)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, boolean includeTableHeader, HssfTableUtils.CellValueConverter converter, StringConverter columnNameConverter)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static void exportToSheet(AggregateTable table, Workbook wb, Sheet sheet, int startRow, int startColumn, HssfTableUtils.CellValueConverter converter)
          Deprecated. Exports the AggregateTable to the specified location of an Excel sheet.
static boolean isHssfInstalled()
          Deprecated. 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
 

Constructor Detail

HssfAggregateTableUtils

public HssfAggregateTableUtils()
Deprecated. 
Method Detail

isHssfInstalled

public static boolean isHssfInstalled()
Deprecated. 
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(AggregateTable table,
                             String fileName,
                             String sheetName,
                             boolean append)
                      throws IOException
Deprecated. 
Exports the AggregateTable to an Excel file.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader)
                      throws IOException
Deprecated. 
Exports the AggregateTable to an Excel file.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Deprecated. 
Exports the AggregateTable to an Excel file.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String fileName,
                             String sheetName,
                             boolean append,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Deprecated. 
Exports the AggregateTable to an Excel file.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             OutputStream out,
                             String sheetName)
                      throws IOException
Deprecated. 
Exports the AggregateTable to as Excel file output steam.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             OutputStream out,
                             String sheetName,
                             boolean includeTableHeader)
                      throws IOException
Deprecated. 
Exports the AggregateTable to as Excel file output steam.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             OutputStream out,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Deprecated. 
Exports the AggregateTable to as Excel file output steam.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             OutputStream out,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter)
                      throws IOException
Deprecated. 
Exports the AggregateTable to as Excel file output steam.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                             OutputStream out,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String sheetName,
                             boolean includeTableHeader,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter)
                      throws IOException
Deprecated. 
Exports the AggregateTable to as Excel file output steam.

Parameters:
table - the AggregateTable 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

exportToSheet

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

Parameters:
table - the AggregateTable 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(AggregateTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 HssfTableUtils.CellValueConverter converter)
Deprecated. 
Exports the AggregateTable to the specified location of an Excel sheet.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader)
Deprecated. 
Exports the AggregateTable to the specified location of an Excel sheet.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter converter)
Deprecated. 
Exports the AggregateTable to the specified location of an Excel sheet.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter converter,
                                 StringConverter columnNameConverter)
Deprecated. 
Exports the AggregateTable to the specified location of an Excel sheet.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                                 int firstRow,
                                 int firstColumn,
                                 int numberOfRows,
                                 int numberOfColumns,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter cellValueConverter)
Deprecated. 
Exports the AggregateTable to the specified location of an Excel sheet.

Parameters:
table - the AggregateTable 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(AggregateTable table,
                                 int firstRow,
                                 int firstColumn,
                                 int numberOfRows,
                                 int numberOfColumns,
                                 Workbook wb,
                                 Sheet sheet,
                                 int startRow,
                                 int startColumn,
                                 boolean includeTableHeader,
                                 HssfTableUtils.CellValueConverter cellValueConverter,
                                 StringConverter columnNameConverter)
Deprecated. 
Exports the AggregateTable to the specified location of an Excel sheet.

Parameters:
table - the AggregateTable 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.

exportToSheet

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

Parameters:
table - the AggregateTable 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)
Deprecated. 
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