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)
Text and dynamic Text and newStringToDisplay
ThomasPz
<p>Hello,</p>
<p> </p>
<p>I often use text-fields with javascript in <value-of> tags. Often concatinated strings also. Normally I set the result at the end of the script in the variable "newStringToDisplay".</p>
<p> </p>
<p>Sample</p>
<pre class="_prettyXprint _lang-js">
<value-of>
var s = "Hello";
var t = "World";
var u = s + " " + t;
newStringToDisplay = u;
</value-of>
</pre>
<p>Now I have some differences between my developement (windows workstation) and my production use (linux). Locally the result of the script is displayed, but in my production not. I couldn't see any logging output or any errors.</p>
<p> </p>
<p>My Question:</p>
<p>Ist it correct to use the "newStringToDisplay" variable or does this variable only exists in dynamic-text environement? </p>
<p>Could anyone explain me, how the results of text and dynamic-text will be transfered to the diplayed text in the birt Report-Result?</p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
ThomasPz
<p>Hello,</p>
<p> </p>
<p>I determine an error in log. The problem wasn't the use of newStringToDisplay.</p>
<p>As First Statement I log to system.out with:</p>
<pre class="_prettyXprint _lang-js">
Packages.java.lang.System.out.println("Start of script");
</pre>
<p>an then I get an error</p>
<p> </p>
<p>ReferenceError: "Packages" is not defined.</p>
PaulCooper
<p>Normally JS expressions return the last object executed. The last object is and assignment not a value. I suggest you do this:</p>
<pre class="_prettyXprint">
<value-of>
var s = "Hello";
var t = "World";
var u = s + " " + t;
newStringToDisplay = u;
newStringToDisplay;
</value-of>
</pre>
<p>The new last line is the expression returned.</p>