Home
Analytics
Scripted data source-JSON-dynamic report generation
skorada
Hi,<br />
i am trying to create a java application for generation of reports using birt run time api's,with data source as a web service(scripted data source) . web service returns JSON object , which the application have to parse at run time and create a data-set, the data is used to create reports.<br />
<br />
user have to just give the web service url, the application should parse the data provided by the webservice in JSON format and output the report.<br />
<br />
I am not finding any documentation in net about how to use <strong class='bbc'>data set event handler</strong><br />
<br />
can any one please help me out. if any one have done a similar kind of work please share the code or logic for doing this.<br />
<br />
Thanks in advance
Find more posts tagged with
Comments
skorada
Can any one help me out plz.
i need an example for dataSet event Adapter. This will solve my problem.
DavidGress
<p>I'm in the same boat as you. Unfortunately, there doesn't seem to be an easy way to do this and it's not supported by Actuate.</p><p> </p><p>Here's some links you may find useful though.</p><p><a data-ipb='nomediaparse' href='
http://www.birt-exchange.org/forum/index.php?/blog/45/entry-471-use-json-as-a-scripted-data-set/'>http://www.birt-exchange.org/forum/index.php?/blog/45/entry-471-use-json-as-a-scripted-data-set/</a></p><p> </p><p><a
data-ipb='nomediaparse' href='
http://www.birt-exchange.org/devshare/_/designing-birt-reports/1561-rest-api-oda-plugin-for-birt'>http://www.birt-exchange.org/devshare/_/designing-birt-reports/1561-rest-api-oda-plugin-for-birt</a></p>
;
johnw
<p>You can parse the JSON into something easily usable in a scripted data source using two ways.</p><p> </p><p>1) Use the old school JSON parsing method of eval(). This will return an object that can be traversed in the scripted data source.</p><p>2) Use GSON in a Java event handler. This is my preferred method. You build the object structure in Java, and use GSON to parse the JSOn string into the correct structure. </p>