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

      • 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 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:
        java.lang.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
      • close

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