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 populate array dynamically from BIRT Dataset and store array in reportContext PGV
Migrateduser
<p><span style="font-size:medium;">[font="calibri;"]Hi,[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]I am working on BIRT v2.6.1 (open source reporting tool from eclipse) and I have the following requirement:[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]I have to populate an array dynamically based on the data retrieved from one “BIRT Data Set†and once the array is populated, I need to store the array in the “reportcontext†as a PersistentGlobalVariable.[/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]And in another “BIRT Data Setâ€, I have to retrieve the array from the “reportcontext†using “<strong>[color=rgb(75,172,198);]reportContext.getPersistentGlobalVariable("myArray");â€[/color]</strong>[/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]This is what I have done:[/font]</span></p><p><span style="font-size:medium;">[font="calibri;"]I have a dataset named <strong>[color=rgb(75,172,198);]“Library Data Setâ€.[/color]</strong>[/font] The query for the dataset is <strong>[color=rgb(75,172,198);]“SELECT LIBRARY_ID FROM TABLE1â€.[/color]</strong></span></p><ul class='bbc'><li><span style="font-size:medium;">[font="calibri;"]In the “Library Data Setâ€->beforeOpen event, I have written the following code:[/font]</span></li></ul><p><strong>[color=rgb(75,172,198);]<span style="font-size:medium;">[font="calibri;"]idx=0;[/color][/font]</span></strong></p><p><strong>[color=rgb(75,172,198);]<span style="font-size:medium;">[font="calibri;"]myArray=[];[/color][/font]</span></strong></p><ul class='bbc'><li><span style="font-size:medium;">[font="calibri;"]In the “Library Data Setâ€->onFetch event, I have written the following code:[/font]</span></li></ul><p><strong>[color=rgb(75,172,198);]<span style="font-size:medium;">[font="calibri;"]myArray[idx++] = row["LIBRARY_ID"];[/color][/font]</span></strong></p><ul class='bbc'><li><span style="font-size:medium;">[font="calibri;"]In the “Library Data Setâ€->beforeClose event, I have written the following code:[/font]</span></li></ul><p><strong>[color=rgb(75,172,198);]<span style="font-size:medium;">[font="calibri;"]reportContext.setPersistentGlobalVariable("myArray",myArray);[/color][/font]</span></strong></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]But it I not working. [/font]</span></p><p> </p><p><span style="font-size:medium;">[font="calibri;"]Could anyone kindly help me in this regard?[/font]</span></p>
Find more posts tagged with
Comments
There are no comments yet