Skip to main content



      Home
Home » Archived » BIRT » DataSet using Java Classes
DataSet using Java Classes [message #147058] Wed, 22 March 2006 11:06 Go to next message
Eclipse UserFriend
Hello all,

I am using BIRT 2.0,Eclipse 3.1 and Tomcat 5.5. My objective is to
retrieve data from Java classes(Vectors,Hashtables) and import them into
my Dataset.

For this I wrote Java classes,which generate data from the database and
return the data in the form of a Vector(made up of String arrays).

I used JavaScript(Rhino) for importing these packages and used the
methods. My code is :

open tab
-----------

importPackage(Packages.mypackage);

myclass = new Connection();
rowdata = myclass.readData();
totalrows = rowdata.size();
currentrow = 0;

fetch tab
----------

if(currentrow >= totalrows)
{ return(false);}

var favrow = rowdata.get(currentrow);
var Customer = favrow[0];
var Favorite = favrow[1];
var Color = favrow[2];

row["Customer"] = Customer;
row["Favorite"] = Favorite;
row["Color"] = Color;
currentrow = currentrow+1;
return (true);


close tab
----------
rowdata = null;
tmsreportclass = null;


The DataSet shows the values in the preview results but the values dont
show in the preview tab.Could someone guide me if they had this error
before

best wishes
Re: DataSet using Java Classes [message #147960 is a reply to message #147058] Fri, 24 March 2006 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Ravi,

Maybe this will help. I have a simple project that uses the
java.lang.System object to get the properties of the system and to
display them a report.

Scott Rosenbaum
BIRT PMC

Ravi wrote:
>
> Hello all,
>
> I am using BIRT 2.0,Eclipse 3.1 and Tomcat 5.5. My objective is to
> retrieve data from Java classes(Vectors,Hashtables) and import them into
> my Dataset.
>
> For this I wrote Java classes,which generate data from the database and
> return the data in the form of a Vector(made up of String arrays).
>
> I used JavaScript(Rhino) for importing these packages and used the
> methods. My code is :
>
> open tab
> -----------
>
> importPackage(Packages.mypackage);
>
> myclass = new Connection();
> rowdata = myclass.readData();
> totalrows = rowdata.size();
> currentrow = 0;
>
> fetch tab
> ----------
>
> if(currentrow >= totalrows)
> { return(false);}
>
> var favrow = rowdata.get(currentrow);
> var Customer = favrow[0];
> var Favorite = favrow[1];
> var Color = favrow[2];
>
> row["Customer"] = Customer; row["Favorite"] = Favorite; row["Color"] =
> Color; currentrow = currentrow+1;
> return (true);
>
>
> close tab
> ----------
> rowdata = null;
> tmsreportclass = null;
>
>
> The DataSet shows the values in the preview results but the values dont
> show in the preview tab.Could someone guide me if they had this error
> before
>
> best wishes
>
Re: DataSet using Java Classes [message #148681 is a reply to message #147058] Mon, 27 March 2006 15:58 Go to previous message
Eclipse UserFriend
hi. there is an example in the BIRT examples about how to retrieve
information from a scripted data base (java). take a look 'cause it
answers your question.
Previous Topic:Headed paper
Next Topic:Question on Total.max (wanting to evaluate over a values computed from grouped data)
Goto Forum:
  


Current Time: Thu Jun 05 00:44:07 EDT 2025

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

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

Back to the top