Skip to main content



      Home
Home » Archived » BIRT » Birt
Birt [message #252972] Mon, 20 August 2007 05:02 Go to next message
Eclipse UserFriend
Originally posted by: ejantjies.momentum.co.za

My first BIRT report uses a scripted datasource.
I'm using birt ver 2.2
I've copied the .jar file to the scriptlib, under the Birtviewer plugin.
The .jar file contains all the XMLBeans with all of the getters and
setters.

Now I want to test the first section , by creating sample data.
Birt is unable to creat an Instance of a class in the .jar file

I get this error:
There are errors evaluating script
"importPackage(Packages.momentum.wealth.statement);

if(currentrow >= totalrows)
return false;

var statement = new Statement();




I does not seem like it's creating an instance of the class statement.

Please help

Thanks
Elizabeth
Re: Birt [message #252984 is a reply to message #252972] Mon, 20 August 2007 10:19 Go to previous message
Eclipse UserFriend
Hi Elizabeth,

I didn't had any problems integrating BIRT with JEE apps and using
scripted data sources to display tables. I used the session to communicate
between BIRT and the app or scriptable java objects added to the task in
the Report Engine.

Now back to your problem, I used the following example:
/*DisplayVo.java*/

package org.myPackage.vo;

public class DisplayVo implements java.io.Serializable{
private String firstString;

public DisplayVo()
{
firstString="";
}

public String getFirstString() {
return firstString;
}
public void setFirstString(String firstString) {
this.firstString = firstString;
}
}


compile the class and copy the binary in the proper location. Now the
rptdesign file is:

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 2.0.1 Build
&lt;20060222-1204></property>
<property name="units">in</property>
<method name="initialize"><![CDATA[var frame=new Packages.DisplayVo();

frame.setFirstString("aaaa");]]></method>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new
Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<data id="61">
<expression
name="valueExpr">this.valueExpr=frame.getFirstString();
this.valueExpr+="\n";

</expression>
</data>
<data id="34">
<expression name="valueExpr"></expression>
</data>
</body>
</report>


Thanks pretty much it.

Hope it helps,
Cristian
Previous Topic:Which version of BIRT should be used for RAD6 + LWI ?
Next Topic:Extend the JDBC Datasource?
Goto Forum:
  


Current Time: Thu Jul 17 08:45:44 EDT 2025

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

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

Back to the top