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
      Constructs a Wrq2ExcelSheetDataWriter instance for exporting data into an Excel sheet by processing a WrsRequest. This constructor initializes the writer with relevant request options, Excel workbook, XML event information, and other configurations to prepare for the data writing process.
      Parameters:
      options - The IRequestOptions defining the request's settings and environment, such as request document, bindings, or configurations.
      workbook - The Workbook representing the Excel workbook where data will be written.
      eventRoot - The XMLEvent representing the root event of the XML structure being processed.
      eventReader - The XMLEventReader for consuming XML events in a streaming manner during processing.
      pathStack - A Stack<String> representing the navigation path of the XML structure for context tracking.
      includeHeader - A boolean flag indicating whether the Excel sheet should include header information.
      Throws:
      de.businesscode.bcdui.wrs.export.ExcelWriterException - If an error occurs during the initialization or creation of the writer.
  • 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