Prerequisites
- Administrator access to attach files to Polarion LiveDoc documents
- Familiarity with Apache Velocity template syntax
- A working Risksheet document with PDF export enabled
How PDF Export Scripts Work
When you trigger a PDF export, Risksheet follows this processing chain:- Loads the
risksheetPdfExport.vmtemplate from the document attachment or inherited template - Renders the Velocity template with access to
pdfExportMacros.vmhelpers - Executes the generated JavaScript against the exporter object
- Produces the final PDF document
Create a Custom Export Script
Step 1: Create the Template File
Create a file namedrisksheetPdfExport.vm with your custom export logic:
Step 2: Attach to the Document
- Open the LiveDoc document in Polarion.
- Navigate to the document attachments.
- Upload the
risksheetPdfExport.vmfile as an attachment. - Save the document.
Step 3: Test the Export
Save the document and trigger a PDF export from the Risksheet view. The output should now follow your custom layout.Available Export Methods
The exporter object provides these methods for building your PDF layout:
Set
exporter.emptyPlaceholder = "N/A" before exporting to display custom text for empty cells.
For full method signatures, parameters, and cell formatting behavior, see the PDF Export Template reference.
Velocity Context and Macros
The Velocity template has access to the full Polarion Velocity context, including:$document— the current Polarion document object$transaction— the current transaction context- Custom macros from
pdfExportMacros.vm(page breaks, table helpers)
Complete Example: FMEA Report
Troubleshooting
Verification
You should now see a PDF export that follows your custom layout. Verify that:- The main sheet appears with the correct visible columns
- Rating tables display the expected scale definitions
- Downstream tables show deduplicated linked items
- Page breaks appear where you placed
#newPage()calls
See Also
- Export to PDF — standard PDF export workflow and validation
- Add Multi-Page Images to PDF — repeating headers and logos across pages
- Control Column Visibility in Exports — managing column visibility