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¶
- If no rendered file exists (or
overwriterequested), callsCreate(overwrite)directly — note: unlike Print a letter or report, this callsCreatedirectly rather than Render a letter or report, so the XML is (re)built but not necessarily re-rendered to bytes first.* - If
m_reportXmlis notNothingandReportPackageis non-empty, callsxPrint.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.* - On failure: exception is caught (see step 3).
- Exceptions are caught and recorded as an
ErrorDetail; returnsTrueonly 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 returnsTrueonly on success. - A discrepancy exists between this operation sending
m_reportXml.ToString()(plain XML) versus Render a letter or report sendingm_reportXml.ToXpression(custom xPression markup) to the same downstreamclsPrintoperations — this could be intentional (different consumers) or a latent inconsistency; not confirmable from this library's code alone.**
Related documentation¶
Sources¶
SAIF.Services.Printing\Reporting\ReportBase.vb