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)
Set the value of the Data within a Row
oamit1978
I am pretty new to BIRT and have started just a day or two back. I have created a dataset and displaying the same inside a table. My problem in that in one my column I am expecting the values as 30.0;0.0;null where in I want replace each ";" with a "\n" so that while display each delimetre separated value is shown in a new row. I am trying to write an Event Handler for this however I couldn't locate on which event (whether onCreate, onPrepare and onRender) I should write this. Also how should I set the value of the data element to my desired value.
Find more posts tagged with
Comments
averma
Hi oamit1978,<br />
You can do this with a simple JavaScript expression in your data element for that column. Here is an example that replaces all semicolons with a newline:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
str = "a;b;c";
str.replace(/;/g, "\n");
</pre>
oamit1978
Thanks for your prompt response. Your code did helped me in solving some other issues however the mentioned problem I manage to solve by adding the REPLACE() function to my dataset SQL itself.
averma
Handling at the database layer is even more efficient approach.