Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
How to display a value in report depending on data fetched from DB
Migrateduser
<p>BIRT Version 4.3.2</p>
<p>Java 1.8</p>
<p> </p>
<p> </p>
<p>from the database I receive numeric values of codes <br>
now according to the code value received I have to display a string in the report</p>
<p> </p>
<p>example :</p>
<p> </p>
<p>Code values = {1,2,3}</p>
<p>Corresponding string to be displayed = {"ABC", "XYZ", "MNO"}</p>
<p> </p>
<p>how do I do the mapping of the codes to their respective display strings and in the report, display the string ?<br><br>
<br>
I tried by having a data element with expression - <span style="font-size:12px;"><strong><em>valueOf(displaystring)</em></strong></span></p>
<p>
and in the onPrepare script of the data element I've put - </p>
<p> </p>
<p><span style="font-size:12px;"><strong><em>var displaystring ;<br>
var val = valueOf(dataSetRow["CODE"]);</em></strong></span></p>
<p><span style="font-size:12px;"><strong><em>if (val = 816240) { displaystring = "smith"; }<br>
else if (val = 162002) { displaystring = "johnson"; }<br>
else if (val = 162003) { displaystring = "williams"; }<br>
else if (val = 162003) { displaystring = "smith"; }<br>
else if (val = 162002) { displaystring = "johnson"; }<br>
else if (val = 162003) { displaystring = "williams"; }<br>
else if (val = 162003) { displaystring = "smith"; }<br>
else if (val = 162002) { displaystring = "johnson"; }<br>
else if (val = 162003) { displaystring = "williams"; }</em></strong></span></p>
<p> </p>
<p> </p>
<p> </p>
<p>This doesn't work. Could anyone help me out with this ?</p>
<p> </p>
<p>Thanks !!</p>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet