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
  • 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

      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:
      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 interface IDataWriter
      Parameters:
      options - - the options used for ths request
      generator - - the generator used for the request
      resultSet - - data to write out. Can be null if generator was empty
      duration - - the database execution duration in MS
      Throws:
      Exception
    • getRowCount

      public int getRowCount()
      IDataWriter Number of rows written
      Specified by:
      getRowCount in interface IDataWriter
      Returns:
      The number of rows written with last write
    • getColumnsCount

      public int getColumnsCount()
      Specified by:
      getColumnsCount in interface IDataWriter
      Returns:
      The number of columns written with last write.
    • close

      public void close() throws Exception
      IDataWriter Close the target resource
      Specified by:
      close in interface IDataWriter
      Throws:
      Exception