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)
Evaluating HTML text
tkopets
Hi,<br />
<br />
How to write a script to evaluate HTML text expression using birt engine to get the same output as this does Text element with HTML formating.<br />
<br />
I tried like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.text = reportContext.evaluate("Date is: <VALUE-OF>new Date();</VALUE-OF>");</pre>
Which does not work.<br />
<br />
Alternatively, is there any way to get evaluated text (actual text that appears on report) of Text element in script?
Find more posts tagged with
Comments
mwilliams
Where are you writing this script? If you're writing it in a script method or an expression builder and not in a text box, you wouldn't need the <value-of> tag. You'd just need to use the script new Date().
Like:
temp = new Date();
this.text = "Date is: " + temp.toString();
Or something similar.
tkopets
This script should be executed in onPrepare of text element.
This question is related to other topic of displaying report header in footer.
I had an idea to store evaluated text in global reportContext variable and later display it in footer.