Skip to content

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

  1. Design-mode PDF preview (previewPDF). The caller supplies a package name and XML payload.
  2. The Package property setter stores the value, stripping a trailing .pkg extension if present (BR-007).
  3. XML is stored as-is.
  4. The method calls the private xpreviewPDF wrapper with the normalized package name, the XML, and the literal application label "xPression Design".
  5. xpreviewPDF forwards the call to the generated xpresso.clsGenerate.previewPDF SOAP proxy and returns the resulting byte array.
  6. Document preview without an explicit profile (previewDocument(package, xml)). The caller supplies a package name and XML payload.
  7. Package and XML are stored the same way as step 1 (BR-007).
  8. The public overload calls the private, parameterless previewDocument() worker.
  9. Document preview with an explicit profile (previewDocument(package, xml, outputProfile)). The caller additionally supplies an output profile name.
  10. Package, XML, and OutputProfile are all stored on the instance.
  11. The overload then calls the same private previewDocument() worker used in step 2.
  12. Shared preview call. The private previewDocument() worker calls m_Xpresso.previewDocument(m_Package, m_XML, m_OutputProfile, m_Application) on the xPression SOAP proxy and returns the byte array response.
  13. m_Application defaults to "xPression Design" and m_OutputProfile defaults to "PDF" unless previously changed by the caller (for example, through SetDefaultProfile/SetDraftProfile on a ReportBase-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.*
  • previewPDF always uses the literal application label "xPression Design" regardless of the Application property value, so callers that changed Application still get design-mode behavior for this specific call.
  • If a package name ending in .pkg (any case) is supplied, the stored Package value silently omits the suffix; callers inspecting clsPrint.Package after the call see the normalized value, not their original input.

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