PDF export requires the sheet to be in a clean state. The export command validates two conditions before proceeding:
Condition
Check
Behavior if Failed
Unsaved changes
isDirty() returns true
Export blocked; user prompted to save
Comparison mode
ComparisonManager exists
Export blocked; user must exit comparison view
Always save your changes before exporting to PDF. The export reads the last saved revision of the document to ensure the PDF reflects a consistent, committed state.
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.
Controls how merged cells are rendered in the PDF export. Logged during export initialization.
masterMergeOnly
boolean
See application
Determines whether the PDF export uses a flat table structure or hierarchical row merging. When true, only master-level merges are applied.
emptyPlaceholder
string
null
Text to display in the PDF for null or empty cells. When null, empty cells are left blank. Set this in your custom export script to show a placeholder like "-" or "N/A".
Comma-separated list of column binding names to exclude from the PDF output. Columns are temporarily hidden during export and restored afterward.
// Export main grid, hiding the internal ID and revision columnsexporter.exportMainSheet("systemItemId,systemItemRevision");// Export all visible columnsexporter.exportMainSheet("");
Use hideColumns to exclude internal or administrative columns that are useful in the interactive grid but not needed in printed output. The columns are hidden temporarily during PDF rendering and restored immediately after.
Exports a filtered sub-table containing only rows where a specified control column has non-empty values.
Parameter
Type
Description
controlColumn
string
Column binding name used to filter rows. Only rows where this column has a non-empty value are included.
// Export a sub-table of mitigation tasksexporter.exportSubTable("mitigationTask");
Typical use cases include exporting separate tables for mitigation tasks, verification activities, or other task-level data that you want to present independently from the main risk table.
Exports downstream traceability tables with deduplication. Unlike exportSubTable, this function tracks which control column values have already been processed and skips duplicate rows, producing a table of unique downstream relationships.
Parameter
Type
Description
controlColumn
string
Column binding name for the downstream link. Rows with duplicate values in this column are excluded after the first occurrence.
Exports a risk rating definition table with three columns: ID, Label, and Description. Rating data is read from the ratings object in the risksheet.json configuration.
Parameter
Type
Description
ratingId
string
Key in the config.ratings object identifying which rating scale to export.
The generated export script has access to the following scope variables:
Variable
Type
Description
exporter
object
Export helper object providing all export* functions listed above.
PDFExport
object
Low-level PDF generation API for advanced customization.
GridPDF
object
Grid-to-PDF rendering engine.
isInCompare
boolean
Whether the export is running in comparison mode.
compareRevision
string
Revision being compared against (if in comparison mode).
currentRevision
string
Current document revision being exported.
showUnchanged
boolean
Whether to include unchanged rows in comparison exports.
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.
The export engine automatically handles cell formatting for different column types:
Column Type
PDF Rendering
Text / String
Plain text value
Boolean / Checkbox
true or false text
Enum
Resolved display name from enum configuration
Multi-Enum
Comma-separated list of resolved display names
Item Link
Label text from the linked work item
Multi-Item Link
Newline-separated list of linked item labels
Server-Rendered HTML
Stripped to plain text with line breaks preserved from list items
System Item ID
Standard item identifier
Calculated / Formula
Computed value at time of export
Empty / Null
Value of emptyPlaceholder if set, otherwise blank
Based on reported issues, be aware of the following PDF export behaviors:
Enum fields: Regular enums export with display titles, but rating fields (numeric IDs) and user reference fields may export with internal IDs instead of display names. Use saved views as an alternative export mechanism for consistent formatting.
Risk matrix calculations: Risk matrix totals in PDF export may not correctly count risks across all severity categories in some configurations. Verify risk matrix counts against the interactive grid.
Long text overflow: Tables may not automatically expand to accommodate long text content. Test your PDF export with representative data to verify layout.
Baselines: PDF export baseline display may show incorrect or missing baselines in variant projects. Baselines should be identified by document ID/path for reliability.
The risksheetPdfExport.vm template follows the same inheritance chain as the main risksheet.json 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
To create a document-specific PDF export template, use Menu > Override Template to detach from the inherited configuration, then attach a custom risksheetPdfExport.vm file to the document.