---
title: SAIF.Services.Printing operations and processes
summary: Operation catalog and cross-operation hub for the xPression and SSRS report preview, print, distribution, and serialization workflows.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Services.Printing
reference_type: package
---

# SAIF.Services.Printing operations and processes

This page is the operation catalog and cross-operation hub for `SAIF.Services.Printing`. The library exposes nine operations across two independent transport paths — an xPression SOAP/MSMQ path (`clsPrint`, consumed directly or through the `IReport`/`ReportBase` workflow) and an SSRS SOAP path (`clsRSPrint`) — plus a standalone XML serialization step used to prepare xPression payloads. Each operation's detailed, step-by-step logic lives in its own page under `operations/`.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules |
| --- | --- | --- | --- | --- | --- |
| [Preview document via xPression](operations/preview-document-via-xpression.md) | Render xPression output as preview bytes, via design-mode PDF preview or profile-based document preview | Caller invokes `clsPrint.previewPDF` or `previewDocument` | Package name, XML payload, optional output profile | Preview byte array | [BR-007](business-rules.md#br-007-package-name-normalization-strips-a-trailing-pkg-extension) |
| [Print rendered PDF](operations/print-rendered-pdf.md) | Send an already-rendered PDF byte array to the configured printer | Caller invokes `clsPrint.printPDF` with rendered bytes | PDF bytes, printer settings | Boolean success | — |
| [Distribute document (synchronous or asynchronous)](operations/distribute-document.md) | Send a distribution request directly to xPression or queue it transactionally in MSMQ | Caller invokes `clsPrint.distributeDocument` | Package name, XML payload, printer and delivery settings | Boolean success | [BR-001](business-rules.md#br-001-distribution-mode-follows-the-asynchronous-flag), [BR-002](business-rules.md#br-002-asynchronous-distribution-must-commit-or-abort-an-msmq-transaction), [BR-007](business-rules.md#br-007-package-name-normalization-strips-a-trailing-pkg-extension) |
| [Render report](operations/render-report.md) | Create or reuse rendered report bytes through the `IReport` workflow | Caller invokes `ReportBase.Render`, or `Print`/`Distribute`/`Save` invoke it internally | Report package, report XML (via `Create`), output profile | Cached rendered bytes | [BR-003](business-rules.md#br-003-report-rendering-selects-the-default-printer-by-execution-platform), [BR-004](business-rules.md#br-004-rendered-bytes-are-reused-until-overwrite-is-requested) |
| [Print report](operations/print-report.md) | Render if needed, then print through `clsPrint` | Caller invokes `ReportBase.Print` | Printer name, optional overwrite flag | Boolean success | [BR-004](business-rules.md#br-004-rendered-bytes-are-reused-until-overwrite-is-requested) |
| [Distribute report](operations/distribute-report.md) | Create report XML if needed, then distribute it through `clsPrint` | Caller invokes `ReportBase.Distribute` | Optional overwrite flag | Boolean success | [BR-001](business-rules.md#br-001-distribution-mode-follows-the-asynchronous-flag) |
| [Save report](operations/save-report.md) | Render if needed and persist report bytes to disk | Caller invokes `ReportBase.Save` | Destination file path, optional overwrite flag | Saved file | [BR-004](business-rules.md#br-004-rendered-bytes-are-reused-until-overwrite-is-requested) |
| [Preview SSRS report](operations/preview-ssrs-report.md) | Render a parameterized SSRS report through the SOAP execution service | Caller invokes `clsRSPrint.PreviewDocument` | Report path, optional parameters, selected format | Rendered report bytes | [BR-006](business-rules.md#br-006-ssrs-distribution-is-not-implemented) |
| [Serialize XDesign XML tree](operations/serialize-xdesign-xml-tree.md) | Convert the report XML tree into xPression-compatible markup, propagating keys | Caller invokes `XDesignXDocument.ToXpression` or `XDesignXElement.ToXpression` | `XDesignXDocument` or `XDesignXElement` | Serialized XML text | — |

## Process flow diagram
The following diagram shows how a consumer moves from an `IReport`-derived report through rendering to print, distribution, or saving, and how the standalone xPression and SSRS entry points relate to it.

```mermaid
flowchart TD
	Start([Consumer holds an IReport<br>or calls clsPrint/clsRSPrint directly]) --> Which{Which workflow?}
	Which -->|IReport workflow| Render[Render report:<br>Create XML, resolve printer,<br>call preview service]
	Render --> Serialize[Serialize XDesign XML tree<br>ToXpression]
	Serialize --> Action{Caller action?}
	Action -->|Print| Print[Print report]
	Action -->|Distribute| Dist[Distribute report]
	Action -->|Save| Save[Save report]
	Print --> PrintPDF[Print rendered PDF]
	Dist --> DistDoc[Distribute document<br>sync or async]
	Which -->|Direct xPression call| PreviewDirect[Preview document via xPression]
	Which -->|Direct xPression call| DistDoc
	Which -->|Direct xPression call| PrintPDF
	Which -->|SSRS| SSRS[Preview SSRS report]
```

## Database interactions

`SAIF.Services.Printing` does not perform any direct database access. All operations communicate with the xPression document-generation SOAP service, an MSMQ queue, or the SSRS `ReportExecutionService` SOAP endpoint; no `database-tables.md` or SQL catalog exists for this library.

## Failure and edge-case behavior
- [Render report](operations/render-report.md) returns `False` and records an `ErrorDetail` when exceptions occur during rendering, and also returns `False` without an error entry when report XML or the report package is missing after `Create`.
- [Print report](operations/print-report.md) and [Save report](operations/save-report.md) do not proceed to print or write a file when rendered bytes are unavailable after a render attempt.
- `clsRSPrint.DistributeDocument` always throws `NotImplementedException` ([BR-006](business-rules.md#br-006-ssrs-distribution-is-not-implemented)); SSRS reports must be distributed through the xPression-based [Distribute document (synchronous or asynchronous)](operations/distribute-document.md) operation instead.
- Asynchronous [Distribute document (synchronous or asynchronous)](operations/distribute-document.md) aborts its MSMQ transaction on exceptions before re-throwing the error ([BR-002](business-rules.md#br-002-asynchronous-distribution-must-commit-or-abort-an-msmq-transaction)).
- [Save report](operations/save-report.md) does not guard against a `Nothing` rendered-bytes array before writing to disk if rendering failed silently.**

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Business rules](business-rules.md)
- [Configuration](configuration.md)
- [API reference](api/index.md)

> **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`
- `Services\SAIF.Services.Printing\clsRSPrint.vb`
- `Services\SAIF.Services.Printing\Reporting\ReportBase.vb`
- `Services\SAIF.Services.Printing\Reporting\IReport.vb`
- `Services\SAIF.Services.Printing\Reporting\XDesignXDocument.vb`
- `Services\SAIF.Services.Printing\Reporting\XDesignXElement.vb`
