Package de.businesscode.bcdui.wrs.export
Class Wrq2ExcelSheetDataWriter
java.lang.Object
de.businesscode.bcdui.wrs.export.AbstractExcelSheetDataWriter
de.businesscode.bcdui.wrs.export.Wrq2ExcelSheetDataWriter
- All Implemented Interfaces:
IDataWriter
Takes a wrq:WrsRequest an optional rnd:Wrs2Excel, executes it and writes the result into an Excel sheet via Poi Api
The caller is responsible to create the Workbook containing the Sheet
-
Field Summary
Fields inherited from class de.businesscode.bcdui.wrs.export.AbstractExcelSheetDataWriter
colTypes, currentColIdx, currentRowIdx, defaultSheetName, log, pathStack, sheet, sheetName, startColIdx, startRowIdx, usingTemplate, workbook, wrsHeaderCols
-
Constructor Summary
ConstructorsConstructorDescriptionWrq2ExcelSheetDataWriter
(IRequestOptions options, org.apache.poi.ss.usermodel.Workbook workbook, XMLEvent eventRoot, XMLEventReader eventReader, Stack<String> pathStack, boolean includeHeader) AbstractExcelSheetDataWriter
Handling a WrsRequest, we consume wrs:WrsRequest XMLEvent up to the closing tag -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
IDataWriter
Close the target resourceint
int
IDataWriter
Number of rows writtenboolean
process()
AbstractExcelSheetDataWriter
Execute Wrq and write result to sheetvoid
write
(IRequestOptions options, ISqlGenerator generator, ResultSet resultSet, long duration) IDataWriter
Take the resultSet and put its content into the prepared sheetMethods inherited from class de.businesscode.bcdui.wrs.export.AbstractExcelSheetDataWriter
attr, cleanup, getCellAt, getCellAtCursor, getPath, moveToNextColumn, moveToNextLine, openSheet, resetColCursor, resetRowColCursor, resetRowColStartIdx, resetRowCursor, setStartColIdx, setStartRowIdx, track, writeCell, writeHeaderCell, wrs2ExcelInfo
-
Constructor Details
-
Wrq2ExcelSheetDataWriter
public Wrq2ExcelSheetDataWriter(IRequestOptions options, org.apache.poi.ss.usermodel.Workbook workbook, XMLEvent eventRoot, XMLEventReader eventReader, Stack<String> pathStack, boolean includeHeader) throws de.businesscode.bcdui.wrs.export.ExcelWriterException AbstractExcelSheetDataWriter
Handling a WrsRequest, we consume wrs:WrsRequest XMLEvent up to the closing tag- Parameters:
eventReader
-event
-- Throws:
XMLStreamException
de.businesscode.bcdui.wrs.export.ExcelWriterException
-
-
Method Details
-
getLoader
-
getGenerator
-
process
public boolean process() throws de.businesscode.bcdui.wrs.export.ExcelWriterExceptionAbstractExcelSheetDataWriter
Execute Wrq and write result to sheet- Returns:
- maxRowsExceeded
- Throws:
Exception
de.businesscode.bcdui.wrs.export.ExcelWriterException
-
write
public void write(IRequestOptions options, ISqlGenerator generator, ResultSet resultSet, long duration) throws Exception IDataWriter
Take the resultSet and put its content into the prepared sheet- Specified by:
write
in interfaceIDataWriter
- Parameters:
options
- - the options used for ths requestgenerator
- - the generator used for the requestresultSet
- - data to write out. Can be null if generator was emptyduration
- - the database execution duration in MS- Throws:
Exception
-
getRowCount
public int getRowCount()IDataWriter
Number of rows written- Specified by:
getRowCount
in interfaceIDataWriter
- Returns:
- The number of rows written with last write
-
getColumnsCount
public int getColumnsCount()- Specified by:
getColumnsCount
in interfaceIDataWriter
- Returns:
- The number of columns written with last write.
-
close
IDataWriter
Close the target resource- Specified by:
close
in interfaceIDataWriter
- Throws:
Exception
-