JIDE 3.5.15

com.jidesoft.hssf
Class HssfTableScrollPaneUtils

java.lang.Object
  extended by com.jidesoft.hssf.HssfTableUtils
      extended by com.jidesoft.hssf.HssfTableScrollPaneUtils

public class HssfTableScrollPaneUtils
extends HssfTableUtils

HssfTableScrollPaneUtils is a class that has methods to export TableScrollPane to Excel (.xls) file format using HSSF-POI.

Please set the client property HssfTableUtils.CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT for the target TableScrollPane 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.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jidesoft.hssf.HssfTableUtils
HssfTableUtils.CellValueConverter, HssfTableUtils.ContextSensitiveCellValueConverter, HssfTableUtils.DefaultCellValueConverter, HssfTableUtils.POICustomizer
 
Field Summary
 
Fields inherited from class com.jidesoft.hssf.HssfTableUtils
CLIENT_PROPERTY_EXCEL_OUTPUT_FORMAT, CLIENT_PROPERTY_FLUSH_ROWS, CLIENT_PROPERTY_USE_SXSSF_WORKBOOK, EXCEL_OUTPUT_FORMAT_2003, EXCEL_OUTPUT_FORMAT_2007
 
Constructor Summary
HssfTableScrollPaneUtils()
           
 
Method Summary
static boolean export(TableScrollPane table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, HssfTableUtils.CellValueConverter converter)
          Exports the pivot table to Excel file.
static boolean export(TableScrollPane table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter)
          Exports the pivot table to Excel file.
static boolean export(TableScrollPane table, OutputStream out, int firstRow, int firstColumn, int numberOfRows, int numberOfColumns, String sheetName, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter, HssfTableUtils.POICustomizer customizer)
          Exports the pivot table to Excel file.
static boolean export(TableScrollPane table, OutputStream out, String sheetName)
          Exports the pivot table to Excel file as an output steam.
static boolean export(TableScrollPane table, OutputStream out, String sheetName, HssfTableUtils.CellValueConverter converter)
          Exports the pivot table to Excel file.
static boolean export(TableScrollPane table, String fileName, String sheetName, boolean append)
          Exports the TableScrollPane to Excel file.
static boolean export(TableScrollPane table, String fileName, String sheetName, boolean append, HssfTableUtils.CellValueConverter converter)
          Exports the pivot table to Excel file.
static boolean export(TableScrollPane table, String fileName, String sheetName, boolean append, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter)
          Exports the pivot table to Excel file.
static boolean export(TableScrollPane table, String fileName, String sheetName, boolean append, HssfTableUtils.CellValueConverter cellValueConverter, StringConverter columnNameConverter, HssfTableUtils.POICustomizer customizer)
          Exports the pivot table to Excel file.
static Sheet exportToSheet(Workbook wb, String sheetName, TableScrollPane pane, HssfTableFormat format)
          Export TableScrollPane to sheet.
 
Methods inherited from class com.jidesoft.hssf.HssfTableUtils
export, export, export, export, export, export, export, export, export, export, export, export, exportToCell, exportToSheet, exportToSheet, exportToSheet, exportToSheet, exportToSheet, exportToSheet, exportToSheet, exportToSheet, isHssfInstalled, isXssfInstalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HssfTableScrollPaneUtils

public HssfTableScrollPaneUtils()
Method Detail

export

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

Parameters:
table - the TableScrollPane.
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 hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the file.

export

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

Parameters:
table - the TableScrollPane.
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.
converter - the converter to converts cell value to the value that can be set to Excel cell. Please note, this converter is only used to convert the cell in the data area, not any cells in row header or column header area.
Returns:
true if exporting succeed. If hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the file.

export

public static boolean export(TableScrollPane table,
                             String fileName,
                             String sheetName,
                             boolean append,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter)
                      throws IOException
Exports the pivot table to Excel file.

Parameters:
table - the TableScrollPane.
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.
cellValueConverter - the converter to converts cell value to the value that can be set to Excel cell. Please note, this converter is only used to convert the cell in the data area, not any cells in row header or column header area.
columnNameConverter - the converter to convert the column name.
Returns:
true if exporting succeed. If hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the file.

export

public static boolean export(TableScrollPane table,
                             String fileName,
                             String sheetName,
                             boolean append,
                             HssfTableUtils.CellValueConverter cellValueConverter,
                             StringConverter columnNameConverter,
                             HssfTableUtils.POICustomizer customizer)
                      throws IOException
Exports the pivot table to Excel file.

Parameters:
table - the TableScrollPane.
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.
cellValueConverter - the cellValueConverter to converts cell value to the value that can be set to Excel cell. Please note, this cellValueConverter is only used to convert the cell in the data area, not any cells in row header or column header area.
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 hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the file.

export

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

Parameters:
table - the TableScrollPane.
out - the output stream
sheetName - the worksheet name.
Returns:
true if exporting succeed. If hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the OutputStream.

export

public static boolean export(TableScrollPane table,
                             OutputStream out,
                             String sheetName,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Exports the pivot table to Excel file.

Parameters:
table - the TableScrollPane.
out - the output stream
sheetName - the worksheet name.
converter - the converter to convert cell value to the value that can be set to Excel cell.
Returns:
true if exporting succeed. If hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the OutputStream.

export

public static boolean export(TableScrollPane table,
                             OutputStream out,
                             int firstRow,
                             int firstColumn,
                             int numberOfRows,
                             int numberOfColumns,
                             String sheetName,
                             HssfTableUtils.CellValueConverter converter)
                      throws IOException
Exports the pivot table to Excel file.

Parameters:
table - the TableScrollPane.
out - the output stream
firstRow - the first row in TableScrollPane to be exported
firstColumn - the first column in TableScrollPane to be exported
numberOfRows - the row count in TableScrollPane to be exported
numberOfColumns - the column count in TableScrollPane to be exported
sheetName - the worksheet name.
converter - the converter to convert cell value to the value that can be set to Excel cell.
Returns:
true if exporting succeed. If hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the OutputStream.

export

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

Parameters:
table - the TableScrollPane.
out - the output stream
firstRow - the first row in TableScrollPane to be exported
firstColumn - the first column in TableScrollPane to be exported
numberOfRows - the row count in TableScrollPane to be exported
numberOfColumns - the column count in TableScrollPane to be exported
sheetName - the worksheet name.
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 hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the OutputStream.

export

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

Parameters:
table - the TableScrollPane.
out - the output stream
firstRow - the first row in TableScrollPane to be exported
firstColumn - the first column in TableScrollPane to be exported
numberOfRows - the row count in TableScrollPane to be exported
numberOfColumns - the column count in TableScrollPane to be exported
sheetName - the worksheet name.
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 hssf.jar is not in the classpath, false will be returned. Exception will be thrown if there is error during the exporting.
Throws:
IOException - if if an I/O error occurs when writing to the OutputStream.

exportToSheet

public static Sheet exportToSheet(Workbook wb,
                                  String sheetName,
                                  TableScrollPane pane,
                                  HssfTableFormat format)
Export TableScrollPane to sheet.

Parameters:
wb - the workbook
sheetName - the sheet name
pane - the table scroll pane
format - the output format
Returns:
the sheet contains the exported table

JIDE 3.5.15