Report distribute¶
Builds a report's XML (if not already built) and distributes it through clsPrint.distributeDocument, following the same MSMQ-or-direct dispatch used by the underlying distribution operation.
| Field | Value |
|---|---|
| Operation ID | OP-08 |
| Trigger | Distribute invoked |
| Inputs | overwrite As Boolean = False, ReportPackage, report XML from Create |
| Outputs | Boolean success |
| Primary components | ReportBase.Distribute, Create, clsPrint.distributeDocument |
| Entry point | Public Function Distribute(Optional overwrite As Boolean = False) As Boolean |
Steps¶
- If
m_reportFile Is Nothingoroverwriteis requested, callsCreate(overwrite)to (re)buildm_reportXml. This does not go throughRender— there is no rendered-bytes cache check and no printer resolution here; them_reportFileflag is used only as a trigger forCreate, andCreatedoes not itself populatem_reportFile. - Checks that
m_reportXmlis notNothingandReportPackage.Length > 0before distributing — a report can be rendered or distributed only when its XML document exists and a report package is assigned (BR-PRT-008). - If the precondition fails:
resultremainsFalse, and no error is recorded. - Calls
xPrint.distributeDocument(ReportPackage, m_reportXml.ToString)— note that this passesm_reportXml.ToString(the raw XML document's default string representation), notm_reportXml.ToXpressionasRenderdoes in OP-06. - This is a structural inconsistency*:
Distributedoes not route through the xPression-dialect serializer used elsewhere in this library, so it does not benefit from BR-PRT-016, BR-PRT-017, BR-PRT-018, or BR-PRT-019 at all.
Origin: The
distributeDocumentcall is the same operation documented as Distribute a document (BR-PRT-001, BR-PRT-003 through BR-PRT-006, BR-PRT-013). 4. Setsresult = Trueon success. 5. If any exception occurs in steps 1–4, it is caught, appended toErrorsasNew ErrorDetail("An error occurred distributing the report.", ex), andresultremainsFalse— the exception is never rethrown (BR-PRT-010).
Process flow¶
flowchart TD
Start([Distribute called]) --> Need{"reportFile Nothing<br>OR overwrite?"}
Need -->|Yes| Create["Create()"]
Need -->|No| Skip["skip create"]
Create --> Pre{"xml set AND<br>package set?"}
Skip --> Pre
Pre -->|No| Fail(["Return False<br>(no error added)"])
Pre -->|Yes| Dist["distributeDocument<br>(package, xml.ToString)<br>(→OP-04)"]
Dist --> Ok(["Return True"])
Create -.->|exception anywhere| Err["Add ErrorDetail"]
Pre -.->|exception anywhere| Err
Dist -.->|exception anywhere| Err
Err --> Fail2(["Return False"])
Failure and edge-case behavior¶
- Exceptions never propagate out of
Distribute; callers must inspectErrorsrather than rely on a thrown exception (BR-PRT-010) — the same non-throwing contract as Report render lifecycle, though with a distinct error message ("An error occurred distributing the report." versus "An error occurred while rendering the report."). Distributeserializes with.ToStringinstead of.ToXpression, an explicit structural inconsistency* relative to OP-06/OP-11.
Related documentation¶
- Index
- Overview
- Architecture
- Dependencies
- Operations and processes
- Business rules
- Configuration
- API reference
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
SAIF.Services.Printing/Reporting/ReportBase.vbSAIF.Services.Printing/Reporting/IReport.vb