Skip to content

Distribute a letter or report

Ensures a report/letter's XML has been built, then distributes it as plain XML string content via the internally owned clsPrint instance.

Field Value
Operation ID OP-REPORTING-DISTRIBUTE
Trigger Caller invokes Reporting.ReportBase.Distribute(overwrite)
Inputs overwrite flag
Outputs Boolean success flag
Primary components Reporting.ReportBase.Distribute
Entry point SAIF.Services.Printing\Reporting\ReportBase.vb

Steps

  1. If no rendered file exists (or overwrite requested), calls Create(overwrite) directly — note: unlike Print a letter or report, this calls Create directly rather than Render a letter or report, so the XML is (re)built but not necessarily re-rendered to bytes first.*
  2. If m_reportXml is not Nothing and ReportPackage is non-empty, calls xPrint.distributeDocument(m_ReportPackage, m_reportXml.ToString) — delegates to Distribute a document — sending the report as plain XML (ToString), rather than the xPression markup (ToXpression) used by Render a letter or report.*
  3. On failure: exception is caught (see step 3).
  4. Exceptions are caught and recorded as an ErrorDetail; returns True only on success.

Process flow

flowchart TD
    Start([Distribute called]) --> Check{Rendered file exists and not overwrite?}
    Check -->|No| Create[Call Create directly]
    Check -->|Yes| HasXml[XML already available]
    Create --> HasXml2{m_reportXml not Nothing and ReportPackage non-empty?}
    HasXml2 -->|No| EndFail([Return False, no distribution])
    HasXml2 -->|Yes| Distribute[Call xPrint.distributeDocument with plain XML string]
    HasXml --> Distribute
    Distribute --> EndOk([Return True])
    Distribute -->|Exception| Error[Record ErrorDetail]

Failure and edge-case behavior

  • Exceptions during distribution are caught and recorded as an ErrorDetail; the method returns True only on success.
  • A discrepancy exists between this operation sending m_reportXml.ToString() (plain XML) versus Render a letter or report sending m_reportXml.ToXpression (custom xPression markup) to the same downstream clsPrint operations — this could be intentional (different consumers) or a latent inconsistency; not confirmable from this library's code alone.**

Sources

  • SAIF.Services.Printing\Reporting\ReportBase.vb