Skip to content

Report print

Ensures a report has been rendered — reusing a cached render or forcing a fresh one — and then sends the resulting bytes to a caller-supplied printer.

Field Value
Operation ID OP-07
Trigger Print invoked
Inputs printer As String, overwrite As Boolean = False, cached or freshly rendered ReportFile
Outputs True/False
Primary components ReportBase.Print, Render, clsPrint.printPDF
Entry point Public Function Print(printer As String, Optional overwrite As Boolean = False) As Boolean

Steps

  1. If m_reportFile Is Nothing or overwrite is requested, calls Render(overwrite) first to ensure a rendered file exists (or is refreshed).

Origin: This step is the full Report render lifecycle operation, including its render-result caching (BR-PRT-007) and non-throwing failure handling (BR-PRT-010), invoked inline. 2. Checks whether m_reportFile is not Nothing — i.e., whether rendering (new or cached) actually produced bytes. - If False: printing is skipped and result remains False. - Note: Render's own return value is not checked here — only the resulting m_reportFile state is. A Render call that returned False due to a caught exception but left a stale m_reportFile populated (e.g., from a prior successful render before a later overwrite failure) would still be treated as printable.* 3. If m_reportFile is not Nothing: sets xPrint.Printer = printer (the caller-supplied printer, distinct from Render's own default-printer resolution — BR-PRT-009) and calls xPrint.printPDF(m_reportFile).

Origin: The printPDF call is the same operation documented as Print rendered bytes, which always reports unconditional success (BR-PRT-013). 4. Returns True if step 3 ran, False otherwise.

Process flow

flowchart TD
    Start([Print called]) --> Need{"reportFile Nothing<br>OR overwrite?"}
    Need -->|Yes| Render["Render()<br>(→OP-06)"]
    Need -->|No| Skip["skip render"]
    Render --> Have{"reportFile<br>now set?"}
    Skip --> Have
    Have -->|No| Fail(["Return False"])
    Have -->|Yes| SetPrinter["Set Printer"]
    SetPrinter --> PrintPDF["printPDF<br>(→OP-03, BR-PRT-013)"]
    PrintPDF --> Ok(["Return True"])

Failure and edge-case behavior

  • Unlike Render and Distribute, Print has no try/catch of its own: any exception from printPDF (itself normally suppressed to True per BR-PRT-013, but whose underlying SOAP call can still throw) propagates directly out of Print — a contrast with OP-06's and OP-08's non-throwing contract.
  • No ErrorDetail is ever added by Print itself, even on the result = False path from step 2.

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

  • SAIF.Services.Printing/Reporting/ReportBase.vb
  • SAIF.Services.Printing/Reporting/IReport.vb