Export Pipeline
Template Location
The template follows the same inheritance hierarchy as sheet configuration. If no
risksheetPdfExport.vm is attached to the current document, Risksheet searches the template hierarchy. See Template Path Configuration.
Configuration Properties
Export Script Scope Variables
The rendered JavaScript export script has access to these scope variables:Export Methods
exportMainSheet
Exports the primary Risksheet grid to PDF.hideColumns are temporarily hidden during export and restored after PDF generation.
exportSubTable
Exports a filtered sub-grid containing only rows where the specified control column has non-empty values.exportDownstreamTable
Exports downstream traceability tables with deduplication based on control column values.exportRatingTable
Exports risk rating definition tables with three columns: ID, Label, and Description.exportEnumTable
Exports enumeration value tables showing ID, Label, and Description.exportCustomTableData
Exports arbitrary tabular data with custom column definitions.Cell Formatting in PDF
The PDF export engine handles different column types automatically:Export Properties
Validation Requirements
PDF export requires a clean document state:- Export is blocked if the sheet has unsaved changes (
isDirty()returnstrue) - Export is blocked when comparison mode is active
- Save the document before exporting to ensure the PDF reflects a consistent state
Multi-Page Behavior
When risk items span multiple pages, text from linked elements (hazard, hazardous situation, harm) may repeat on the next page for context. This is by design but can be interpreted as duplicate entries by reviewers. Cell height calculation may truncate text for linked elements in some cases.
Images on Multiple Pages
Thedoc.pageAdded event only applies to the page where it is called. To display a logo or header image on every page, call doc.pageAdded after each #newPage() invocation. It does not automatically repeat for table overflow pages.
Complete Example
Related Pages
- PDF Export API — programmatic export interface
- Velocity Template Context — available context variables
- Velocity Templates — template engine reference
- Top Panel Template — top panel customization