Skip to main content



      Home
Home » Archived » BIRT » Empty Table
Empty Table [message #708339] Tue, 02 August 2011 13:52 Go to next message
Eclipse UserFriend
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 14:12 Go to previous messageGo to next message
Eclipse UserFriend
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 01:37 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 19:08:57 EDT 2025

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

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

Back to the top