а

ExportToPDF() within Salesforce Lightning


#1

Hi there,

I have a Gantt chart embedded in a Salesforce Lightning component, everything is working fine except this export feature. I’m trying to export a Gantt content to PDF, PNG or Excel.

When I add ‘http://export.dhtmlx.com/gantt/api.js’, to scripts, the gantt chart does not load anymore (see exception further).

<ltng:require
scripts="{!join(’,’,
$Resource.gantt + ‘/dhtmlxgantt.js’,
$Resource.gantt + ‘/ext/dhtmlxgantt_marker.js’,
http://export.dhtmlx.com/gantt/api.js’,
$Resource.gantt + ‘/ext/dhtmlxgantt_csp.js’
)}"
styles="{!$Resource.gantt + ‘/dhtmlxgantt.css’}"
afterScriptsLoaded="{!c.setup}"/>

I can see the exception below in my chrome inspector.
Does anybody has any hint on how to deal with this error :

aura_prod.js:24 Refused to connect to 'http://export.dhtmlx.com/gantt/api.js' because it violates the following Content Security Policy directive: "connect-src 'self' https://api.bluetail.salesforce.com https://staging.bluetail.salesforce.com https://preprod.bluetail.salesforce.com *.cs22.visual.force.com https://xxxxxxxxxxxx--c.cs22.content.force.com https://cs22.salesforce.com".

https://xxxxxxxxxxxx–c.cs22.content.force.com = my salesforce org on which the Gantt library is delpoyed.

One precision : I added http://export.dhtmlx.com/gantt/api.js to my org trusted sites, but this has no effects


#2

Hello Sylvain,
We received your tickets in the support system. Let’s continue our discussion there.