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)
How do I iterate data set result with javascripit
Xiaodon Xia
<p>Hi, my birt report is querying our database table but there's one column which is json data. So I need to get each value of that column, parse the json data and then display on report by columns instead of displaying the json data directly on the report. What's the best way to do it ? I'm thinking about iterating the data set and get each cell value of the json column, parse it, then reconstruct the report. All done in javascript. But how do I iterate my dataset ?</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>Using a JSON parser such as <a data-ipb='nomediaparse' href='
https://github.com/douglascrockford/JSON-js/blob/master/json2.js'>this
one</a>, you can create computed columns in your data set based on the JSON data field coming from the database. For example, based on a data set like this one:</p>
<p>
pricher
<p>Quick update: As of BIRT Open Source 4.5.0, the JSON parser is built-in. There is no need to include json.js as a resource.</p>
<p> </p>
<p>P.</p>
Xiaodon Xia
<p>Thank you so much for the reply. My version is 4.4, so I was trying to add json.js, but I couldn't find it anywhere. I went to Resources -> Javascript Files -> Add File, all I see is Flash Object Library.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>Based on what you are saying, I believe you are using BIRT Commercial. </p>
<p> </p>
<p>I am sending you the JSON javascript library that you will need to include to your BIRT project. You can unzip the js file to a folder in your BIRT project, like shown here:</p>
<p>
Xiaodon Xia
<p>Thank you very much !</p>