Prerequisites
PDF export requires the sheet to be in a clean state. The export command validates two conditions before proceeding:Server Endpoint
The server loads the
risksheetPdfExport.vm Velocity template, renders it with the full Velocity context (including document, transaction, and pdfExportMacros.vm helper macros), and returns the generated JavaScript code to the browser for execution.
PDF Export Configuration Properties
Template Properties
Export Command Properties
Export Functions
The export script has access to the following functions through theexporter object. Each function renders a specific type of table in the PDF output.
exportMainSheet
Exports the primary Risksheet grid to PDF.exportSubTable
Exports a filtered sub-table containing only rows where a specified control column has non-empty values.exportDownstreamTable
Exports downstream traceability tables with deduplication. UnlikeexportSubTable, this function tracks which control column values have already been processed and skips duplicate rows, producing a table of unique downstream relationships.
exportRatingTable
Exports a risk rating definition table with three columns: ID, Label, and Description. Rating data is read from the Polarion enumeration referenced by therating:<enumId> column, not from any section of the sheet configuration.
exportEnumTable
Exports an enumeration value table showing ID, Label, and Description for a Polarion enumeration referenced by anenum:<enumId> or multiEnum:<enumId> column.
exportCustomTableData
Exports arbitrary tabular data with custom column definitions and optional absolute positioning.Script Context Variables
The generated export script has access to the following scope variables:The export command passes the current application state (
app.state) to the PDF renderer. This means the exported PDF reflects the current view configuration, including top panel settings and active filters.Cell Formatting in PDF
The export engine automatically handles cell formatting for different column types:Template Inheritance for PDF Export
TherisksheetPdfExport.vm template follows the same inheritance chain as the main sheet configuration:
- Document attachment (highest priority) --- Template file attached directly to the LiveDoc document
- Template document --- Inherited from the document’s Polarion template
- Global template --- Project-level default template configuration
risksheetPdfExport.vm file to the document.
Complete Example
A typicalrisksheetPdfExport.vm export script that produces a complete FMEA report:
Progress Feedback
During PDF generation, Risksheet displays a persistent toast notification:
The notification remains visible until the PDF file is generated and the download begins.
Related Pages
- PDF Export Template for the Velocity template syntax and macro reference
- Velocity Template Context for the full list of context variables available in export templates
- Custom Renderer Templates for cell-level rendering customization
- Configuration Properties Index for all configurable properties