Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Regarding Parameters
sotirisioannou
<p>Hello,</p><p> </p><p>So I know that if I want to read a report parameter in javascript the only thing I need to do is to use this:</p><p> </p><p> <VALUE-OF> params["adr"].value; </VALUE-OF></p><p> </p><p>However this works for me only when the parameters are integers. What should I use if I want to read a string for example?</p>
Find more posts tagged with
Comments
Clement Wong
<p>Hi,</p><p> </p><p>It's the same syntax for strings.</p><pre class="_prettyXprint"><VALUE-OF>params["stringParameter"].value</VALUE-OF></pre><p>Not sure why it's not working in your environment. Attached is a sample.</p>
sotirisioannou
<p>Hello,</p><p> </p><p>Thanks for the help. Yes I'm not sure why it's not working for me. Maybe I could start fresh with a new report and try again in case I did something wrong.</p>
sotirisioannou
<p>Ok,</p><p> </p><p>Basically I needed to find a workaround to make this work. What I have done was to use jQuery and place the <span><VALUE-OF></span><span>params["stringParameter"].value</span><span></VALUE-OF> inside an html div</span></p>
probs
<p>Hi,</p>
<p> </p>
<p>I am also getting the same problem. If we are using a text item and using script in it then the string parameter is getting undefined.</p>
<p>eg</p>
<p> </p>
<p><script></p>
<p> </p>
<p>function submit() {</p>
<p>var abc = <VALUE-OF>params["Sort"].value </VALUE-OF>;</p>
<p> </p>
<p>alert(abc);</p>
<p>}</p>
<p> </p>
<p></script></p>
<p> </p>
<p>here if the parameter "Sort" is String then we don't get the value for "abc" . but for integer parameters we get the correct value.</p>
<p> </p>
<p>any suggestions on this topic please.</p>
<p> </p>
<p>Thanks,</p>
<p>Prabal</p>
JFreeman
<p>What version of BIRT are you using?</p>
<p> </p>
<p>Depending on the version and situation, you may need to add quotes around your VALUE-OF expression.</p>
<p>For example:</p>
<pre class="_prettyXprint _lang-js">
var abc = "<VALUE-OF>params["Sort"].value </VALUE-OF>";
</pre>
<p>Also, as of 2.6 there is also a VIEWTIME-VALUE-OF that should be used instead of just VALUE-OF in some situations when working with report variables: <a data-ipb='nomediaparse' href='
https://www.eclipse.org/birt/phoenix/project/notable2.6.php#jump_12'>https://www.eclipse.org/birt/phoenix/project/notable2.6.php#jump_12</a></p>
;
probs
<p>Hi Jesse,</p>
<p> </p>
<p>Sorry for the late reply. I was on a holiday.</p>
<p>I am using Birt ihub 3.1</p>
<p>thank you so much. the above code works.</p>
<p> </p>
<p>Thanks,</p>
<p>Prabal</p>
JFreeman
<p>You're welcome.</p>
<p>I'm glad to hear that worked for you.</p>
<p> </p>
<p>Let us know if you have additional questions.</p>