Class StreamingXlsxToCsvWriter

java.lang.Object
io.jmix.reports.yarg.formatters.impl.streaming.StreamingXlsxToCsvWriter

public class StreamingXlsxToCsvWriter extends Object
Converts a streamed XLSX file into CSV with a single SAX pass, so memory stays O(1) regardless of the row count: semicolon-separated, one line per non-empty sheet row, in document order.

The output approximates the non-streaming engine's saveXlsxAsCsv but is deliberately not byte-identical, because a streamed workbook stores values differently from the docx4j template cells the old engine copies verbatim:

  • Numbers are read back as doubles and normalized by formatNumeric (whole numbers without a trailing .0, never scientific notation). A value the non-streaming engine emitted as 5.0, 45000.0 (a date serial) or 1.2E12 is rendered here as 5, 45000 and 1200000000000.
  • Formula cells carry no cached value (the workbook is written with fullCalcOnLoad), so they come out empty; a row whose only content is a formula is treated as empty and skipped.
  • Empty cells are position-padded from each cell's reference, so a value that does not start in column A keeps its column index instead of being packed to the left as the old engine does.
  • Constructor Details

    • StreamingXlsxToCsvWriter

      public StreamingXlsxToCsvWriter()
  • Method Details

    • convert

      public static void convert(File xlsxFile, OutputStream outputStream)