Skip to main content

Overview

serverRender enables server-side rendering of complex linked item traversals and computed data using Apache Velocity. When this property is set on a column, the configuration manager automatically forces the column data type to text and sets readOnly to true — the column becomes a read-only text column whose content is generated by the Velocity template each time the grid loads. This pattern is essential for multi-level link traversals, rich-text rendering with embedded images, and any computed display that would be impractical to express with client-side formulas alone.
diagram
When serverRender is set on a column definition, the configuration manager automatically forces the column type to text and sets readOnly to true. You do not need to specify these properties manually. This behavior is enforced server-side and cannot be overridden. Text wrapping inside server-rendered cells is controlled through the styles section of the sheet configuration using standard CSS rules — there is no column-level text-wrapping property.

Column Definition Properties

typeProperties Sub-properties

When a server render column is used together with an itemLink-style binding (for example, bindings: task.$item), the same typeProperties block used by link columns applies. These sub-properties control how linked items are resolved before the Velocity template runs.

Velocity Context Variables

The serverRender script has access to Polarion’s Velocity context. The most commonly used variables for server render columns are:

Velocity Syntax: Property Access vs Method Calls

serverRender accepts both Velocity syntax flavours interchangeably:
  • Property access (no parentheses) — chains field navigation directly:
  • Method-call syntax (with parentheses) — uses explicit method invocation:
Both patterns resolve to the same underlying API. Choose whichever style matches the surrounding template; mixing them in the same expression is allowed and common in real configurations.

Basic Configuration

A minimal server render column in the sheet configuration:
This column renders the description field as full HTML, preserving formatting, links, and embedded images. The column is automatically read-only.

Common Patterns

Rich text fields (description, custom HTML fields) display as plain text in standard columns. Use serverRender to render the full HTML including clickable hyperlinks, text formatting, and colors:
The general pattern for any rich text field follows the same structure. Replace the field ID with your target field:
Rich text fields that contain embedded images (such as symbol libraries, diagrams, or screenshots) render inline in the cell using this pattern. If images appear truncated, you can control the display size via CSS in the Top Panel template. When using images from rich text fields, ensure the column width is sufficient to display the image content legibly.
Construct clickable links that navigate to specific Polarion pages, external URLs, or other risksheet documents:
You can also construct redirect links to arbitrary paths:

Displaying Indirectly Linked Work Items

For multi-level linked work items (Level 0 -> Level 1 -> Level 2), where you need to traverse intermediate links to display items that are not directly linked to the current row:
Real aerospace configurations chain three levels of traversal in a single serverRender expression (risk -> task -> requirement -> testcase). The same #foreach over $item.getLinkedWorkItems() is nested and filtered by linkRole at each level.
Server render columns displaying indirectly linked work items are always read-only. For editable multi-level linking, consider the upstreamChains configuration property (format: fromType-linkRole-toType), which automatically creates transitive link chains. Note that upstreamChains only creates links and never deletes them.

Horizontal Line Separators Between Items

When rendering multiple linked items in a single cell, use <hr/> tags to provide visual separation:

Test Execution Records

Use $testManagementService to display the latest test execution result for a work item. $testManagementService.getLastTestRecords($item.getOldApi(), N) returns up to N test records for the current item; $transaction is used to resolve the test run reference:
The available variables in this pattern are $item (current work item), $transaction (current Polarion transaction, used to resolve cross-entity references), and $testManagementService (test management service entry point).

Rendering Work Item Attachments

serverRender can iterate the attachments of a work item using the method-call API surface and emit a clickable link for each one. The attachment URL is generated by chaining .url().linkToOpen().toEncodedRelativeUrl(''):
Each attachment is rendered through .render().htmlFor().forFrame(), which produces an inline HTML representation suitable for display inside the cell.

Outline Number Sorting

To sort risksheet items by their LiveDoc outline number (so that 1.2.10 sorts after 1.2.2), create a server render column that zero-pads each segment of the outline number, then reference the column in the sortBy property:
Without zero-padding, string comparison sorts 1.10.1 before 1.2.2. With padding, 0001.0002.0002 correctly sorts before 0001.0010.0001.

Multi-Project Configuration Properties

When defining server render columns that reference configuration properties across multiple projects, use $config Velocity variables. Space-separated project IDs can be referenced with separate $config lookups:
When using configuration properties to define multi-project upstream columns, empty property values after the = sign cause errors. The alternative project must use a direct project ID, not another configuration property variable. Always ensure configuration property values are non-empty.

Export Behavior

Server render columns produce HTML in the interactive grid. During exports, this HTML is converted to plain text:
The exact HTML-to-text conversion depends on the complexity of your Velocity output. Nested tables, complex CSS, or JavaScript in server render output may not convert cleanly to plain text exports. Test your specific scripts with both Excel and PDF exports.

PDF Export Considerations

When exporting to PDF via custom pdfscript.js, server render columns are handled by the renderDataCell function, which detects columns with serverRender defined and applies HTML-to-text stripping. The emptyPlaceholder property (configurable in custom export scripts) controls what text appears for null or empty server render output in the PDF.

Interaction with Other Column Properties

Complete Example

A full sheet configuration demonstrating multiple server render column patterns in an automotive FMEA context:

See Also

Last modified on July 10, 2026