---
title: Print report
summary: Renders a report if needed, then sends the rendered bytes to a caller-specified printer.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-07-30
library: SAIF.Services.Printing
reference_type: package
operation_id: OP-PRT-05
trigger: Caller invokes ReportBase.Print(printer, overwrite)
---

# Print report

`ReportBase.Print` is the consumer-facing print entry point on the `IReport` workflow. It guarantees rendered bytes are available (rendering on demand) before assigning the requested printer and forwarding the bytes to `clsPrint.printPDF`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-PRT-05 |
| **Trigger** | Caller invokes `ReportBase.Print(printer, overwrite)` |
| **Inputs** | Target printer name; optional `overwrite` flag |
| **Outputs** | Boolean success |
| **Primary components** | `Reporting.ReportBase.Print`, `Reporting.ReportBase.Render`, `clsPrint.printPDF` |
| **Entry point** | `Services\SAIF.Services.Printing\Reporting\ReportBase.vb` |

## Steps

1. `Print` checks whether rendered bytes are missing or `overwrite` is `True`.
   - If so: it calls `Render(overwrite)` — see [Render report](render-report.md) — which reuses cached bytes unless a refresh is needed ([BR-004](../business-rules.md#br-004-rendered-bytes-are-reused-until-overwrite-is-requested)).
2. `Print` checks whether rendered bytes (`m_reportFile`) are now present.
   - If bytes are present: it assigns the caller-supplied `printer` to `xPrint.Printer`, then calls `xPrint.printPDF(m_reportFile)` — see [Print rendered PDF](print-rendered-pdf.md) — and sets `result = True`.
   - If bytes are still absent (render failed or was skipped without producing bytes): `Print` returns `False` without attempting to print.
3. `Print` returns the accumulated `result`.

## Process flow

The following diagram visualizes the render-then-print sequence.

```mermaid
flowchart TD
	Start([Print called with printer, overwrite]) --> NeedRender{Bytes missing<br>or overwrite = True?}
	NeedRender -->|Yes| Render[Call Render overwrite]
	NeedRender -->|No| Check
	Render --> Check{Rendered bytes present?}
	Check -->|No| Fail([Return False])
	Check -->|Yes| SetPrinter[Assign printer to xPrint.Printer]
	SetPrinter --> Send[Call xPrint.printPDF]
	Send --> End([Return True])
```

## Failure and edge-case behavior

- `Print` does not surface the specific reason rendering failed; if `Render` added an `ErrorDetail` to `Errors`, `Print` still simply returns `False` from the byte-presence check without re-raising or re-describing that error.*
- `Print` does not catch exceptions from `xPrint.printPDF` itself; a SOAP fault from the underlying print call propagates directly to the caller.*

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.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\Reporting\ReportBase.vb`
- `Services\SAIF.Services.Printing\clsPrint.vb`
