Package org.wicketstuff.poi.excel
Class TablesComponentAsXlsHandler
- java.lang.Object
-
- org.wicketstuff.poi.excel.TablesComponentAsXlsHandler
-
- All Implemented Interfaces:
IRequestHandler
public class TablesComponentAsXlsHandler extends Object implements IRequestHandler
Request handler that respond the specified table components as a XLS file.
A possible implementation of
Linkon click be:public void onClick() {
IRequestHandler handler = new TablesComponentAsXlsHandler("fileName.xls", table1, table2);
RequestCycle.get().scheduleRequestHandlerAfterCurrent(handler);
}- Author:
- reiern70
-
-
Constructor Summary
Constructors Constructor Description TablesComponentAsXlsHandler(String filename, Component... tableComponents)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddetach(IRequestCycle requestCycle)protected org.apache.poi.ss.usermodel.SheetnewSheet(org.apache.poi.ss.usermodel.Workbook workbook, Component component, int index)Create the sheet in where component table data will be setvoidrespond(IRequestCycle requestCycle)voidsetCellExporter(CellExporter cellExporter)Set the exporter strategy to be used by this handler.
-
-
-
Method Detail
-
respond
public void respond(IRequestCycle requestCycle)
- Specified by:
respondin interfaceIRequestHandler
-
detach
public void detach(IRequestCycle requestCycle)
- Specified by:
detachin interfaceIRequestHandler
-
newSheet
protected org.apache.poi.ss.usermodel.Sheet newSheet(org.apache.poi.ss.usermodel.Workbook workbook, Component component, int index)Create the sheet in where component table data will be set- Returns:
- a new
Sheetto receive the table component data
-
setCellExporter
public void setCellExporter(CellExporter cellExporter)
Set the exporter strategy to be used by this handler. The default isGeneralPurposeExporter- Parameters:
cellExporter-- See Also:
CellExporter
-
-