Custom HTML in TIBCO Spotfire Text Area visualization is not rendered when exporting to image or PDF

Custom HTML in TIBCO Spotfire Text Area visualization is not rendered when exporting to image or PDF

book

Article ID: KB0075080

calendar_today

Updated On:

Products Versions
Spotfire Analyst 10.3.1 and higher

Description

If you have custom HTML or JavaScript widgets that make asynchronous calls in order to generate the required HTML or widgets, in some cases the content cannot be seen while exporting the text area visualization to image or PDF.

A possible cause of this reason is that the TextArea is exported before it finishes to render. 
 

Issue/Introduction

This article explains how to resolve the missing HTML issue when exporting content.

Resolution

Starting from 10.3.1.26 LTS Hotfix HF-007, a new API SF.setBusy() has been introduced which can be used to notify Spotfire when the TextArea visualization is ready for export. While your text area is still rendering you can use SF.setBusy(true) and once it finishes you can set SF.setBusy(false). The export will not render the visualization until a call to SF.setBusy(false) is made. 

You can use this API in your existing JavaScripts by adding a sample script like below:
SF.setBusy(true);
setTimeout(function(){SF.setBusy(false)},300000);

Additional Information

Wiki Article: Best Practices for Writing Custom JavaScript Code in Text Areas