Skip to main content



      Home
Home » Archived » BIRT » NewBie: Scripted DataSources/Datsets ...also charting issues
NewBie: Scripted DataSources/Datsets ...also charting issues [message #100231] Sat, 17 December 2005 18:27 Go to next message
Eclipse UserFriend
Hi Guys,

I've installed 2.0M3 and i have java classes that provide me with a
collection of objects, which i then want to display in multiple tables and
group by different keys (e.g, table by customer, another table by product,
another table by sale amounts, etc)

From examples, i see that people typically implement the open/fecth
functions for the data set. I've noticed that this gets called everytime a
table is populated with the dataset. Now, the java code i have is quite
expensive to run and i want to run it once, and then only use the fetch to
populate the rows. Where should this be done? I currently have a hack in the
open function so that it only gets data from my object once:

//open event script
count = 0;

if (params["load"]){
// call my object
importPackage(Packages.com.test);
data = CustomerDataFactory(params["starttime"], params["stoptime"]);
params["load"]=false;
}

//fetch script
if (count < data.size()){
//populate rows
.....
return true;
}
return false;


The number of rows i have is also potentially large, so i find the report
generation taking quite some time. Is ther a more correct way of doing this?
Also, if i want to share the "data" object with another report (for instance
making a report that analyses only data for a particular customer), is that
posiible?

And finally, if i try to chart something with this dataset, i get a lot of
exception in eclipse...but eventually it plots something.


Sorry for the long list...

Jeff
Re: NewBie: Scripted DataSources/Datsets ...also charting issues [message #100296 is a reply to message #100231] Sun, 18 December 2005 19:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Jeff,

I would have thought that the Data Set would have been cached, but you can
put it on the open method of the Data Source, just make the scope global.
Also you can add global variables in the initialize method of the report,
so you dont have to do the params hack. You could also call the class in
your initialize method.

Jason Weathersby
BIRT PMC
Re: NewBie: Scripted DataSources/Datsets ...also charting issues [message #101658 is a reply to message #100296] Thu, 22 December 2005 10:09 Go to previous message
Eclipse UserFriend
Just put your code you want to ensure to be executed once for the complete
report in the e.g. 'beforeFactory' method of the report (click on the
report, select script tab and select from list box on top to choose the
method).
Mark
Previous Topic:change the java compiler to 5.0
Next Topic:Report Paging in 2.0 M3
Goto Forum:
  


Current Time: Thu Jul 17 05:38:02 EDT 2025

Powered by FUDForum. Page generated in 0.05748 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top