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)
Report resource scripts in chart
kallem
Hello!<br />
<br />
I have included javascript file(s) in report via Report - Resources - Javascript Files. Scripts contained in the file can be used and work ok in all places except in chart script. When I switch to chart's script tab and try to use scripts in the file(s) I get following error:<br />
<br />
<span style='color: #FF0000'>+ ReferenceError: "getPeriodIndex" is not defined. at line x of chart script:''</span><br />
<br />
Is it so that resource scripts can't be used in chart or am I just missing something obvious? I could copy scripts in the chart script to make them work but that leads to copy-paste-update syndrom..<br />
<br />
Thanks in advance,<br />
Kalle
Find more posts tagged with
Comments
mwilliams
It looks like this is a bug. Please log it at
http://www.birt-exchange.org/org/resources/bug-reporting/
.
I was shown a workaround that should work for you for now.
var tt = icsc.getExternalContext().getScriptable().evaluate("getMyValue();");
Where getMyValue is the function in the external js file. This should allow you access to the external javascript file. Let me know if you have issues.
kallem
Thanks Michael! The workaround works nicely after I figured out how to pass parameters. First I got ReferenceErrors from parameters I passed but after trying I found out that setGlobalVariable does the trick e.g.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>icsc.getExternalContext().getScriptable().setGlobalVariable("Name", param);</pre>
I logged bug <a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=326885'>#326885</a>
; about the script reference problem.<br />
<br />
- Kalle