Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using External Javascipt in a report
millvall
Hi,
We have some Javascript functions is a .JS file we use across various web apps. I want to use them from a BIRT Text control and have the control pick it up on the client side vs. copying the JS into the BIRT development project. As a test, I tried the following in a text control
(HTML, Formatting settings.) but BIRT says cannot find myjs().
<SCRIPT>
language="JavaScript"
SRC="myjsclient01.js"
</SCRIPT>
<VALUE-OF>myjs()</VALUE-OF>
myjsclient01.js is simply:
function myjs() { return "Hi from myjs Yipee!"; }
I copied myjsclient01.js to various folders:
C:Program FilesActuate10BRDPro
eclipsepluginscom.actuate.birt.report.viewer_2.3.2.v20081204iportal...
1) WEB-INF
2) js
3) The iportal directory.
Any clues where I need place myjsclient01.js so the previewer/BIRT viewer can access it?
Thanks
Milt.
Find more posts tagged with
Comments
mwilliams
Hi Milt,
Did you add the .JS file as a resource for your report design in the resources section in the property editor?
millvall
Michael,<br />
Thanks for reply. <br />
I was looking for way avoid including the JS in the report directly in order to avoid deployment to multiple locations and provide for single point of maintenance. I think I found the soln in a very old blogspot.<br />
<br />
<a class='bbc_url' href='
http://blogs.zaidsoft.com/sz_quadri/2007/08/20/conditionally_including_javascript_and_css_files.html'>Conditionally
including javascript and css files - SZ Quadri</a><br />
<br />
Regs<br />
Milt.
mwilliams
Milt,
Good to hear. Let me know if you have any other questions.
Virgil Dodson
Hi Milt.
JS files defined in the Resources property of a BIRT report do not have hard coded locations. While in the Designer, put the .JS in the same project so BIRT can find it... and then at runtime, you have only one copy of the .JS file in the resources folder that all reports share.