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)
Chart and crosstab filled with date from arrays in PGV
Adam11
<p>Hello,</p>
<p> </p>
<p>1. It is possilby to create char filled with date from arrays in PGV ? Ihad a crosstab when I used some scripting putting computed date into arrays and after that I wanto make chart based on date from those arrays in PGV. When I look into chart date I can only choose datesat.</p>
<p> </p>
<p>2. It is possilby to create crosschart filled with date from arrays in PGV ? had a crosstab when I used some scripting putting computed date into arrays and after that I wanto make another crosstab filles with data from arrays in PGV.</p>
<p> </p>
<p>I use Eclipse BIRT Designer Version 2.6.2.<br><br>
Thanks in advance for any help<br><br>
Adam<br>
</p>
Find more posts tagged with
Comments
GLO_FR
<p>Hi Adam,</p>
<p> </p>
<p>I have never done that before, but I think that to do it, you have to use a Scripted Data Set.</p>
<p>Get the content of your variable and put it this DS.</p>
<p>Afterward, use this DS directly in your chart.</p>
<p> </p>
<p> </p>
<p>*** Edit ****</p>
<p> </p>
<p>I have tested this method, it works great</p>
Adam11
<p>Thanks for the answer. Do you have some example ?</p>
<p> </p>
<p>Adam</p>
GLO_FR
<p>Sure, here you are (done with BIRT 2.3.2).</p>
<p> </p>
<p>I have created my variable in the beforeFactory. It is a simple array with some values.</p>
<p> </p>
<p>First you have to create a scripted data source and a dataset</p>
<p>After that, in the <strong>beforeOpen </strong>event of your DS, just get your PGV and put it in an array.</p>
<p>Then, on the <strong>fetch </strong>event, just read your array and feed your DS.</p>
<p> </p>
<p>At the end, use your scripted data set the way you want : chart, table.....</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
Adam11
<p>Thanks a lot for the answer. Could You look at my post from<a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/35477-crosstab-overwrite-value-in-cell-using-script-or-put-addtional-row/?view=getlastpost'
title="Go to last post: Crosstab - overwrite value in cell using script or put addtional row"> Yesterday, 07:13 AM about overwriting value in crosstable </a>, no one make a reply to it. Thanks in advance.</p>
<p> </p>
<p>Adam</p>
Adam11
<p>Hello,</p>
<p> </p>
<p>Unfortunatelly, I have still problem with using your method. Can you help me ?</p>
<p>I copied your datastource and dateset to my report. And use in before Open my table from PGV (there are only numbers)</p>
<p> and I change valuetype for integer in dateset.</p>
<p> </p>
<p>Dataset (Before open)</p>
<p>currentRow=0;<br>
myArray=reportContext.getPersistentGlobalVariable("my_table_from_pgv");</p>
<p> </p>
<p>Dateset(Fetch)</p>
<p> </p>
<p>if (currentRow < myArray.length) {<br>
row["VALUE1"] = myArray[currentRow];<br>
currentRow++;<br>
return true;<br>
};<br>
return false;</p>
<p> </p>
<p> </p>
<p>But it doesn;'t work. I have no values in preview. I use console debugging "Packages.java.lang.System.out.println(" with eclipsec and I have strange logs:</p>
<p>(...) Info: Crosstab javascript content registered successfully</p>
<p>Before adding yours dateset I have no such entries. I create my table my_table_from_pgv in such way:</p>
<p>In initialize:</p>
<p>var my_table_from_pgv = new java.util.ArrayList();</p>
<p>and on create cell for crosstab</p>
<p>my_table_from_pgv.add(reportContext.evaluate("measure"));</p>
<p> </p>
<p>Maybe the problem is I used javacript and You use java ? Please. Any help will be appreciated.</p>
<p> </p>
<p>Adam</p>
GLO_FR
<p>If your design works without any connection, can you upload it ?</p>
Adam11
<p>I solved my problem. I changed length function to size() in my_array and it works. Thanks a lot for help.</p>
<p> </p>
<p>Adam,</p>