Interface StreamingReportFormatter

All Superinterfaces:
ReportFormatter
All Known Implementing Classes:
JmixStreamingXlsxFormatter, StreamingXlsxFormatter

@NullMarked public interface StreamingReportFormatter extends ReportFormatter
A ReportFormatter able to render one band from a streaming row feed. The render is split in two phases so that the data source connection is held only while rows are consumed: consumeData() runs inside the streaming loader's callback, completeRendering() writes the result after the cursor and its connection are released.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Second phase: writes or converts the built document to the output stream and releases resources.
    void
    First phase: consumes band data (including the streaming feed) and builds the result document.
    void
    Releases the partially built result (e.g.
    default void
    setReportBandNames(Set<String> reportBandNames)
    Supplies the full set of band names of the report definition, so the template parser can distinguish band named ranges from service/user defined names even for bands that produced no data.
    void
    Injects the feed that supplies the streaming band's rows.

    Methods inherited from interface io.jmix.reports.yarg.formatters.ReportFormatter

    createDocument, renderDocument
  • Method Details

    • setStreamingBandFeed

      void setStreamingBandFeed(StreamingBandFeed streamingBandFeed)
      Injects the feed that supplies the streaming band's rows. Must be set before consumeData().
    • setReportBandNames

      default void setReportBandNames(Set<String> reportBandNames)
      Supplies the full set of band names of the report definition, so the template parser can distinguish band named ranges from service/user defined names even for bands that produced no data. Optional — implementations may fall back to names derivable from the band data tree, hence the no-op default.
    • consumeData

      void consumeData()
      First phase: consumes band data (including the streaming feed) and builds the result document. Must be called inside the streaming loader's callback, while the feed's cursor is alive.
    • completeRendering

      void completeRendering()
      Second phase: writes or converts the built document to the output stream and releases resources. Runs after the loader callback returns, so it must not touch the feed.
    • discard

      void discard()
      Releases the partially built result (e.g. SXSSF spool files) without writing it. Safe to call at any phase and more than once; used by the engine when the streaming loader fails after the render callback succeeded, so temp files do not outlive the report run. Implementations that hold no intermediate resources may make this a no-op, but must still implement it so the release contract is explicit.