Acessing JAVA class using BIRT - Scripted data source [message #136762] |
Tue, 28 February 2006 00:03  |
Eclipse User |
|
|
|
Originally posted by: shruthi.cn.in.bosch.com
Hello everybody,
I have problem using Scripted data source to access a simple java class.
The steps that i am doing are as follows:
1) Create a java class say "SimpleClass" in a package "BirtPack".
2) Create a JAR file for this.
3) Place the JAR in
"<ECLIPSE_INSTALL>\plugins\org.eclipse.birt.report.viewer\birt\WEB-INF\lib "
4) Restart eclipse, Open a rptdesign file.
5) In the open method of Data Set, I include
importPackage(Packages.birtpack);
favoritesClass = new SimpleClass();
favorites = favoritesClass.readData(); /* readData method returns a
vector where each vector item contains 3 strings */
totalrows = favorites.size();
currentrow = 0;
6) In the fetch method, i include the following code
if( currentrow >= totalrows ){
return( false );
}
var favrow = favorites.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 );
7) I have created a table and dragging of the columns into table, is done.
Is there anything that i am missing out. I am getting errors when i see
the preview. I have tried to solve this for hours. I would be greatful to
any help recieved.
Thanks
Best Regards
Shruthi
|
|
|
|
Powered by
FUDForum. Page generated in 0.04066 seconds