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
public class Wrq2ExcelSheetDataWriter extends AbstractExcelSheetDataWriter implements 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
Constructors Constructor Description Wrq2ExcelSheetDataWriter(IRequestOptions options, org.apache.poi.ss.usermodel.Workbook workbook, javax.xml.stream.events.XMLEvent event, javax.xml.stream.XMLEventReader eventReader, java.util.Stack<java.lang.String> pathStack, boolean includeHeader)
AbstractExcelSheetDataWriter
Handling a WrsRequest, we consume wrs:WrsRequest XMLEvent up to the closing tag
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
IDataWriter
Close the target resourceint
getColumnsCount()
ISqlGenerator
getGenerator()
DataLoader
getLoader()
int
getRowCount()
IDataWriter
Number of rows writtenboolean
process()
AbstractExcelSheetDataWriter
Execute Wrq and write result to sheetvoid
write(IRequestOptions options, ISqlGenerator generator, java.sql.ResultSet resultSet, long duration)
IDataWriter
Take the resultSet and put its content into the prepared sheet-
Methods 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 Detail
-
Wrq2ExcelSheetDataWriter
public Wrq2ExcelSheetDataWriter(IRequestOptions options, org.apache.poi.ss.usermodel.Workbook workbook, javax.xml.stream.events.XMLEvent event, javax.xml.stream.XMLEventReader eventReader, java.util.Stack<java.lang.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:
javax.xml.stream.XMLStreamException
de.businesscode.bcdui.wrs.export.ExcelWriterException
-
-
Method Detail
-
getLoader
public DataLoader getLoader()
-
getGenerator
public ISqlGenerator getGenerator()
-
process
public boolean process() throws de.businesscode.bcdui.wrs.export.ExcelWriterException
AbstractExcelSheetDataWriter
Execute Wrq and write result to sheet- Returns:
- maxRowsExceeded
- Throws:
java.lang.Exception
de.businesscode.bcdui.wrs.export.ExcelWriterException
-
write
public void write(IRequestOptions options, ISqlGenerator generator, java.sql.ResultSet resultSet, long duration) throws java.lang.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:
java.lang.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
public void close() throws java.lang.Exception
IDataWriter
Close the target resource- Specified by:
close
in interfaceIDataWriter
- Throws:
java.lang.Exception
-
-