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)
Scripted Dataset to handle Arraylist
shriyakish
Hello all,
I am a newbie in BIRT and already tearing my hair out.
I am retrieving a list of Hashmaps(colName, value) from the database by running a query.
I want the data to be given to the birt report.
I read that you need to write a scripted dataset but I have been unsuccessful so far.
Could somebody pls help me in achieving this?
Thanks.
Find more posts tagged with
Comments
thuston
Why are you getting a collection of collections?
What database are you using?
Can you query a different way and just get a regular result set of values?
shriyakish
I am using Oracle db.
I may be able to get a resultset.
Could you help me how can I get a resultset to display the data in the report design?
mcremer
<blockquote class='ipsBlockquote' data-author="'shriyakish'" data-cid="82153" data-time="1314795208" data-date="31 August 2011 - 05:53 AM"><p>
I am using Oracle db.<br />
<br />
I may be able to get a resultset. <br />
Could you help me how can I get a resultset to display the data in the report design?<br /></p></blockquote>
<br />
Why not connect directly to the Oracle database trought a JDBC connection?
shriyakish
Thankss for the reply.
The framework is already in place and I am afraid I will have to go through the existing framework.
Another reason is , the query is dynamically generated based on user selections on the page.
Hence I pass the query from the jsp to the java end.
Hence, I will have to make do with working with a Collection of data. Atmost I can do some tweaking to get out a resultset.
How can I feed the resultset to the rptDesign to get the data displayed?
thuston
How dynamic do you intend for your report to be? I picture a long painful road of elaborate scripting ahead of you.
If you want your users to be able to write their own reports, you may be better served by looking into Actuate BIRT Studio. It allows you to design queries and your users can select which columns they want and add their own grouping and aggregation. They can then save it and rerun or modify as needed.
shriyakish
The way the report is to be structured is :
The columns displayed in the report is set.
The sql is dynamic in the sense that which table to pull data from depends on user selection.
For eg : if the user selects 2009 for fiscal year, the tables to pull data will be the ones related to 2009 and so on.
Hence, my query is dynamic and I can get the resultset out.
I heard that you can create a handler class that takes in a resultset and gives out rows of data.
I am not sure how to go about it.
thuston
If the Select (output columns) is constant and you essentially only change the From, you should pass the SQL query (or just the From) to BIRT and script to adjust the DataSet's query. As long as the columns, and parameters (if used), are the same and in the same order you can change anything else you want.<br />
<br />
In BeforeOpen you can change <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.queryText = 'new SQL String...'</pre>
shriyakish
Thanks. That worked!