Skip to content

Preview a document

Renders a document from a package name and xPression data XML through the xPression Design web service, returning the rendered bytes for preview purposes without printing or distributing the result.

Field Value
Operation ID OP-01
Trigger clsPrint.previewDocument invoked (two public overloads: (inPackage, inXML) or (inPackage, inXML, inOutputProfile))
Inputs Package name, xPression data XML, optional output profile (defaults to "PDF" when not supplied)
Outputs Rendered document bytes (Byte())
Primary components clsPrint.previewDocument (public overloads), private previewDocument(), m_Xpresso.previewDocument
Entry point SAIF.Services.Printing/clsPrint.vb

Steps

  1. The public 2-argument overload trims and assigns inPackage to the Package property. The package name is normalized by stripping a trailing .pkg extension via the Package setter (BR-PRT-001).
  2. Assigns inXML to the XML property unchanged — no transformation is applied.
  3. The 3-argument overload additionally assigns inOutputProfile to the OutputProfile property, overriding the "PDF" default that would otherwise apply.
  4. Both public overloads delegate to the private parameterless previewDocument(), which calls m_Xpresso.previewDocument(m_Package, m_XML, m_OutputProfile, m_Application) against the xPression Design web service.
  5. The bytes returned by the web service are returned to the caller unchanged — there is no caching and no success/failure flag distinct from the returned bytes.

Process flow

flowchart TD
    Start(["previewDocument invoked"]) --> Norm["Normalize package name"]
    Norm --> SetXML["Set XML<br>(and OutputProfile<br>if 3-arg overload)"]
    SetXML --> Call["Call m_Xpresso.<br>previewDocument<br>via xPression<br>Design service"]
    Call --> End(["Return rendered bytes"])

Failure and edge-case behavior

  • There is no try/catch around the web service call; a SoapException or WebException raised by m_Xpresso.previewDocument propagates directly to the caller, unlike the non-throwing pattern used by ReportBase (BR-PRT-010 describes that separate, non-throwing pattern; this operation does not use it).
  • The 2-argument overload does not set OutputProfile — whichever value was last set on the instance (or the "PDF" default) is used silently, with no indication to the caller that an implicit value is in effect.

Sources

  • SAIF.Services.Printing/clsPrint.vb