Frequently Asked Question

How to enable printing (pdf/xls) of N4V components
Last Updated 2 years ago

Symptom

  • When printing a Webi report in PDF/XLS format, some N4V components are not correctly printed (a puzzle may appear) or there is a very long delay to print the report.

Environment

  • Windows & Linux Server
  • Need4Viz : all versions. Fixed in 2022.0.1 version.

Resolution

Depending on the N4V components printed, the N4V server may need to access internet and/or reach the URL used to access the N4VCustomElements webapp.

A. Components which require an internet access (Simple Sankey; Google maps, OpenStreetMaps)

When printing Webi report containing some N4V components (Sankey, OpenStreet & Google maps components), the N4V server needs to access internet to build the chart and provide a PNG file to Webi (to generate the PDF/XLS final file). If the N4V server has no access to internet, the PNG image file cannot be generated and a long timeout can be reached before a puzzle image is rendered (default image).

To avoid this, two possibilities are offered :

1. It's impossible to set an internet acces to the N4V server

In this case, the PNG images for the corresponding N4V components will never be generated. To avoid the puzzle image and waiting timeout, just set to true the NoExternalWebAccessAllowed variable in the ~Need4Viz\nodejs\node_modules\custom_element\ce_libs\config.js file, so a blank frame with unprintable message will be generated instead of the expected render.

2. An internet access can be set on the N4V server through a proxy :

In this case, you can set in the ~Need4Viz\nodejs\node_modules\custom_element\ce_libs\config.js file the ProxyHost variable (only proxy without authentication can be used)

For both solutions, once the config.js file is updated and saved, you need to restart the N4V services through the following steps :

  1. Open a PowerShell command window as local administror of the server
  2. Change directory to ~Need4Viz_folder_installation/Scripts/
  3. Run the Start_Need4Viz.ps1 command

After that, try to print a Webi report including an impacted N4V component (Sankey, OpenStreet or Google map), the chart should be correctly render in the final PDF/XLS file.

The following URLs must be accessible from the N4V server to print correctly the corresponding N4V components :

Sankey :
https://www.google.com/jsapi
https://www.gstatic.com/charts

Google maps :

https://maps.googleapis.com
https://www.gstatic.com/charts
https://fonts.gstatic.com
https://maps.gstatic.com

OpenStreetMap :

https://*.openstreetmap.org

B. Components which not require an internet access 

When printing Webi report containing some N4V components other than Simple Sankey, OpenStreet or Google maps components, it may arrive than the renderer is a puzzle (after a long delay). Mlost of the time, this is due to an access error from the N4V server to the URL used to access the N4VCustomElements static webapp (for instance, configuration of the server behind a proxy).

To avoid this, two possibilities are offered :

1. Disable proxy for the N4V server 

In this case, the server will be able to access directly the URL defined in the ~Need4Viz\nodejs\node_modules\custom_element\ce_libs\config.js file by the parameters URLNodeJSServer& PORTTomcat without passing through a proxy.

2. Enable N4VCustomElements URL in your proxy

In this case, you need to configure your proxy to authorize the N4V server to access the URL defined in the ~Need4Viz\nodejs\node_modules\custom_element\ce_libs\config.js file by the parameters URLNodeJSServer& PORTTomcat.

Then in the config.js file, configure the parameter ProxyHost parameter with your proxy information. Proxy authentication has to be anonymous (authentication with credentials is not supported for the printing of the N4V components).

Please Wait!

Please wait... it will take a second!