|ArrayLists in scripted data sets [message #841310]
||Wed, 11 April 2012 02:32
| andrew smith
Registered: February 2012
I was wondering if someone could please give me a hint on how to work with ArrayLists from Java in BIRT. Here is my situation:
I have a very basic java code that creates an ArrayList of an ArrayList ie ArrayList<ArrayList<String>> ie 2d table and stores it as one of the properties of the java class.
This ArrayList is used as a scripted data source to populate the data. In the 'open' section of the scripted data set, I have the following:
importPackage(Packages.com.Portfolio); // does not trigger error
importPackage(Packages.java.util); // does not trigger error
importPackage(Packages.java.lang); // does not trigger error
var myPortfolio = new Portfolio('111'); // does not trigger error
var theDataList = myPortfolio.fakeData; // does not trigger error
totalCount = myPortfolio.fakeData.get(0).size(); // does not trigger error - I get a good number here.
counter=0; // does not trigger error
In the fetch section I have:
return(false);} //does not trigger error
var timeLine = new ArrayList(); //does not trigger error - Just declare an ArrayList in Birt
timeLine = theDataList.get(0); //TRIGGERS AN ERROR
//var rorList = theDataList.get(1);
//row["Year"] = timeLine.get(counter);
//row["Ror"] = rorList.get(counter);
counter = counter+1;
The error happens at timeLine = theDataList.get(0); theDataList is a 2d table (ArrayList of an ArrayList) so the theDataList.get(0) should return just a 1d ArrayList. BUT IT BREAKS HERE.
What am I doing wrong?
thanks in advance,
Powered by FUDForum
. Page generated in 0.03543 seconds