Preview document via xPression¶
clsPrint exposes two related preview paths that both return rendered bytes from the xPression document-generation service without printing or distributing anything: a design-mode PDF preview with a fixed application label, and a document preview that uses the object's current (or caller-supplied) output profile. Both paths share the same package-name normalization and store the caller's package/XML state on the clsPrint instance before calling the SOAP proxy.
| Field | Value |
|---|---|
| Operation ID | OP-PRT-01 |
| Trigger | Caller invokes previewPDF(package, xml), previewDocument(package, xml), or previewDocument(package, xml, outputProfile) |
| Inputs | Package name, report XML payload, optional output profile name |
| Outputs | Rendered preview byte array from the xPression service |
| Primary components | clsPrint.previewPDF, clsPrint.xpreviewPDF, clsPrint.previewDocument (public overloads and private worker) |
| Entry point | Services\SAIF.Services.Printing\clsPrint.vb |
Steps¶
- Design-mode PDF preview (
previewPDF). The caller supplies a package name and XML payload. - The
Packageproperty setter stores the value, stripping a trailing.pkgextension if present (BR-007). XMLis stored as-is.- The method calls the private
xpreviewPDFwrapper with the normalized package name, the XML, and the literal application label"xPression Design". xpreviewPDFforwards the call to the generatedxpresso.clsGenerate.previewPDFSOAP proxy and returns the resulting byte array.- Document preview without an explicit profile (
previewDocument(package, xml)). The caller supplies a package name and XML payload. PackageandXMLare stored the same way as step 1 (BR-007).- The public overload calls the private, parameterless
previewDocument()worker. - Document preview with an explicit profile (
previewDocument(package, xml, outputProfile)). The caller additionally supplies an output profile name. Package,XML, andOutputProfileare all stored on the instance.- The overload then calls the same private
previewDocument()worker used in step 2. - Shared preview call. The private
previewDocument()worker callsm_Xpresso.previewDocument(m_Package, m_XML, m_OutputProfile, m_Application)on the xPression SOAP proxy and returns the byte array response. m_Applicationdefaults to"xPression Design"andm_OutputProfiledefaults to"PDF"unless previously changed by the caller (for example, throughSetDefaultProfile/SetDraftProfileon aReportBase-derived report, see Render report).
Process flow¶
The following diagram visualizes the two preview entry points converging on the xPression SOAP proxy.
flowchart TD
Start([Caller supplies package and XML]) --> Norm[Normalize package name<br>strip trailing .pkg]
Norm --> Which{Which entry point?}
Which -->|previewPDF| Design[Call xpreviewPDF with<br>fixed 'xPression Design' label]
Which -->|previewDocument, no profile| Doc1[Use current OutputProfile]
Which -->|previewDocument, with profile| Doc2[Store supplied OutputProfile]
Doc1 --> Shared[Call previewDocument worker]
Doc2 --> Shared
Design --> ProxyPDF[xpresso.clsGenerate.previewPDF]
Shared --> ProxyDoc[xpresso.clsGenerate.previewDocument]
ProxyPDF --> End([Return preview bytes])
ProxyDoc --> End
Failure and edge-case behavior¶
- Neither preview path catches exceptions from the SOAP proxy call; a service fault or communication failure propagates directly to the caller.*
previewPDFalways uses the literal application label"xPression Design"regardless of theApplicationproperty value, so callers that changedApplicationstill get design-mode behavior for this specific call.- If a package name ending in
.pkg(any case) is supplied, the storedPackagevalue silently omits the suffix; callers inspectingclsPrint.Packageafter the call see the normalized value, not their original input.
Related documentation¶
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¶
Services\SAIF.Services.Printing\clsPrint.vb