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) AbstractExcelSheetDataWriterHandling a WrsRequest, we consume wrs:WrsRequest XMLEvent up to the closing tag -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()IDataWriterClose the target resourceintintIDataWriterNumber of rows writtenbooleanprocess()AbstractExcelSheetDataWriterExecute Wrq and write result to sheetvoidwrite(IRequestOptions options, ISqlGenerator generator, ResultSet resultSet, long duration) IDataWriterTake 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 AbstractExcelSheetDataWriterHandling a WrsRequest, we consume wrs:WrsRequest XMLEvent up to the closing tag- Parameters:
eventReader-event-- Throws:
XMLStreamExceptionde.businesscode.bcdui.wrs.export.ExcelWriterException
-
-
Method Details
-
getLoader
-
getGenerator
-
process
public boolean process() throws de.businesscode.bcdui.wrs.export.ExcelWriterExceptionAbstractExcelSheetDataWriterExecute Wrq and write result to sheet- Returns:
- maxRowsExceeded
- Throws:
Exceptionde.businesscode.bcdui.wrs.export.ExcelWriterException
-
write
public void write(IRequestOptions options, ISqlGenerator generator, ResultSet resultSet, long duration) throws Exception IDataWriterTake the resultSet and put its content into the prepared sheet- Specified by:
writein 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()IDataWriterNumber of rows written- Specified by:
getRowCountin interfaceIDataWriter- Returns:
- The number of rows written with last write
-
getColumnsCount
public int getColumnsCount()- Specified by:
getColumnsCountin interfaceIDataWriter- Returns:
- The number of columns written with last write.
-
close
IDataWriterClose the target resource- Specified by:
closein interfaceIDataWriter- Throws:
Exception
-