Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Empty Table
Empty Table [message #708339] Tue, 02 August 2011 17:52 Go to next message
Johannes.Koshy is currently offline Johannes.Koshy
Messages: 30
Registered: July 2011
Member
I have another curious Problem,

I have a Table i fill with Java Script from an Java Class.
I Know that iam getting the Data within the Java Script:
<method name="fetch"><![CDATA[while(iter.hasNext()&amp;&amp;count<10){
mp = iter.next();
row["columnTime"] = mp.getTime();
row["columnMemory"] = mp.getValue();	
Packages.java.lang.System.out.println (mp.getValue());
count ++
}
return false;]]></method>

returns Data in the console.
mp.getTime() return a long Value and mp.getValue() returns a Number object.

What did i do wrong?

thanks for your time.
Re: Empty Table [message #708383 is a reply to message #708339] Tue, 02 August 2011 18:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Johannes,

The fetch script is called for every row of data. And each call must
return true or false. Returning true means there are more rows.
Returning false means there are no more rows. Your fetch processes all
rows in one call. You need to do something like:

if( iter.hasNext() ){
myObject = iter.next();
row["outtercol"] = myObject.getValue().toString();
return true;

}else{

return false;

}

See attached exmaple.

Jason

On 8/2/2011 1:52 PM, Johannes.Koshy wrote:
> I have another curious Problem,
>
> I have a Table i fill with Java Script from an Java Class.
> I Know that iam getting the Data within the Java Script:
> <method name="fetch"><![CDATA[while(iter.hasNext()&&count<10){
> mp = iter.next();
> row["columnTime"] = mp.getTime();
> row["columnMemory"] = mp.getValue();
> Packages.java.lang.System.out.println (mp.getValue());
> count ++
> }
> return false;]]></method>
>
> returns Data in the console.
> mp.getTime() return a long Value and mp.getValue() returns a Number object.
>
> What did i do wrong?
>
> thanks for your time.
Re: Empty Table [message #708713 is a reply to message #708383] Wed, 03 August 2011 05:37 Go to previous message
Johannes.Koshy is currently offline Johannes.Koshy
Messages: 30
Registered: July 2011
Member
Now i got it!
Thank you very much
Previous Topic:adding jars in the classpath of the engine
Next Topic:Report generation process
Goto Forum:
  


Current Time: Tue Sep 16 07:28:42 GMT 2014

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

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