How to add reference to a js file in JSreport

602 views
Skip to first unread message

prab...@gmail.com

unread,
Mar 2, 2017, 5:11:53 AM3/2/17
to jsreport
Hi Blaha,
I need to have reference to uvcharts.js file for creation of charts in my reporting application. How do I add reference to this. I tried using the scripts option but that does not seem to work. Could you  please advice.


Thanks in advance.

Jan Blaha

unread,
Mar 2, 2017, 5:14:08 AM3/2/17
to jsreport, prab...@gmail.com
The jsreport assets should do the job for you

prab...@gmail.com

unread,
Mar 2, 2017, 5:47:17 AM3/2/17
to jsreport, prab...@gmail.com
Hi Blaha,
Thanks for the suggestion. I used the assets option but in the output window I keep getting the following message

Warning: Failed to load http://localhost:5488/assets/content/uvcharts.js <ignore>

 I have following entries in the config file.

"assets": {
  "allowedFiles": "static/**.js",  
  "searchOnDiskIfNotFoundInStore": false,
  "rootUrlForLinks": "http://localhost:5488",
  "publicAccessEnabled": true
 }

Please advice what I am doing wrong here.

Jan Blaha

unread,
Mar 2, 2017, 5:50:47 AM3/2/17
to jsreport, prab...@gmail.com
Please share the minimal template part. Also, did you upload the script as asset through studio or do you want to just link it from the disk?

prab...@gmail.com

unread,
Mar 2, 2017, 6:05:10 AM3/2/17
to jsreport, prab...@gmail.com
Hi,

This is how I refer the asset in html page.
<script src="{#asset uvcharts.js @encoding=link}"></script>

I have uploaded the file through studio.

Jan Blaha

unread,
Mar 2, 2017, 6:30:50 AM3/2/17
to jsreport, prab...@gmail.com
Strange, that works for me.

What version of jsreport you have? Could you compress your data folder and config files and send it to me?

Reply all
Reply to author
Forward
0 new messages