Save a rendered report to disk¶
Persists a rendered report/letter's PDF bytes to a destination file on disk, rendering the report first if necessary.
| Field | Value |
|---|---|
| Operation ID | OP-REPORTING-SAVE |
| Trigger | Caller invokes Reporting.ReportBase.Save(overwrite) |
| Inputs | DestinationFileName, overwrite flag |
| Outputs | Boolean (whether the destination file exists after the operation) |
| Primary components | Reporting.ReportBase.Save |
| Entry point | SAIF.Services.Printing\Reporting\ReportBase.vb |
Steps¶
- Checks whether
DestinationFileNamealready exists on disk. - If it does not exist, or
overwriteis requested, andDestinationFileNameis non-empty: calls Render a letter or report to ensurem_reportFileis populated, then writes the bytes toDestinationFileNameusing aFileStreamopened withFileMode.Create(truncates/creates). - Returns whether the destination file exists after the operation.
Process flow¶
flowchart TD
Start([Save called]) --> Exists{DestinationFileName exists?}
Exists -->|Yes and not overwrite| EndOk([Return True, file exists])
Exists -->|No or overwrite| CheckName{DestinationFileName non-empty?}
CheckName -->|No| EndSkip([Skip write])
CheckName -->|Yes| Render[Call Render to populate m_reportFile]
Render --> Write[Write bytes via FileStream FileMode.Create]
Write --> EndOk
Failure and edge-case behavior¶
- If
DestinationFileNameis empty, no write occurs and the return value reflects whatever existed before the call.*
Related documentation¶
Sources¶
SAIF.Services.Printing\Reporting\ReportBase.vb