ANS-0764 · PRINTING, PDF & EMAIL TEMPLATES

How to Prevent HTML Escaping in NetSuite Printed Column Headers

NetSuite's Advanced PDF/HTML Templates provide the capability to directly embed and control HTML in printed column headers, preventing default entity encoding.

Short answer

It is possible to prevent NetSuite from escaping HTML in printed column headers by utilizing Advanced PDF/HTML Templates. These templates allow for direct embedding and control of HTML, CSS, and FreeMarker, enabling explicit customization of printed output to bypass default HTML entity encoding for elements like column headers.

Scenario

Users often encounter situations where NetSuite automatically encodes HTML entities when data is pulled into standard templates for printed output. This default behavior can lead to HTML tags appearing as raw text in elements such as column headers, rather than rendering as intended. The challenge is to find a method within NetSuite to directly control HTML rendering and prevent this automatic escaping.

Solution

While NetSuite typically encodes HTML entities by default when data is pulled into standard templates for printed output, preventing HTML from rendering as intended, this behavior can be managed. To prevent NetSuite from escaping HTML in printed column headers, users should utilize Advanced PDF/HTML Templates.These templates provide a powerful environment where HTML, CSS, and FreeMarker can be directly embedded and controlled. By customizing an Advanced PDF/HTML Template, users can:

  1. Navigate to Customization > Forms > Advanced PDF/HTML Templates.

  2. Select or create a custom template for the desired record type.

  3. Within the template's source code, explicitly define the HTML structure for column headers. This allows for direct embedding of HTML tags without NetSuite automatically converting them into HTML entities.

  4. Ensure the FreeMarker syntax correctly outputs the desired HTML without further escaping, often by using directives that prevent auto-escaping if specific data fields are involved.

Expert NetSuite Support

Need help with this NetSuite issue?

Printing, PDF & Email Templates consulting and configuration support

Talk to a consultant