Problems with return in fetch of Scripted Data Set [message #42019] |
Wed, 01 June 2005 10:30  |
Eclipse User |
|
|
|
I am using the following code of the example from Scott Rosenbaum, in a
Data Set of a Scripted Data Source. The code is used in the fetch method.
if (count < 10 ) {
count++;
row.columnAny = count;
row["columnString"] = "String nummer" + count;
row[3] = count * count;
return true;
}
return false;
when I try to preview the results the following exception occurs:
org.eclipse.birt.data.engine.core.DataException occurred
Error Code:DATA_EXCEPTION_SCRIPT_EVAL_ERROR
Error Code:DATA_EXCEPTION_SCRIPT_EVAL_ERROR
Error Message:Error evaluating script (source:DataSet:data.fetch,
line:5): invalid return (DataSet:data.fetch#5).
invalid return (DataSet:data.fetch#5)
Has anyone an idea what is wrong here?
|
|
|
Re: Problems with return in fetch of Scripted Data Set [message #42051 is a reply to message #42019] |
Wed, 01 June 2005 12:48  |
Eclipse User |
|
|
|
Johannes,
I believe that the problem is in the versions of BIRT. In versions of
BIRT prior to the 5/25/2005 (includes the M3 build) the BIRT methods
were not true 'methods'. Instead they were expressions that were
evaluated in the Reporting engine, the value returned by the expression
was equal to the last assignment made in the method (see code below).
On 5/25/2005 BIRT changed the engine to evaluate the JavaScript methods
using a defined return value.
So you have two choices, either a) update to a more recent version of
BIRT or b) change your code as follows:
if (count < 10 ) {
count++;
row.columnAny = count;
row["columnString"] = "String nummer" + count;
row[3] = count * count;
true;
}
false;
Hope this helps,
Scott Rosenbaum
BIRT PMC
Johannes Matheis wrote:
> I am using the following code of the example from Scott Rosenbaum, in
> a Data Set of a Scripted Data Source. The code is used in the fetch
> method.
>
> if (count < 10 ) {
> count++;
> row.columnAny = count;
> row["columnString"] = "String nummer" + count;
> row[3] = count * count;
> return true;
> }
> return false;
>
> when I try to preview the results the following exception occurs:
>
> org.eclipse.birt.data.engine.core.DataException occurred
> Error Code:DATA_EXCEPTION_SCRIPT_EVAL_ERROR
> Error Code:DATA_EXCEPTION_SCRIPT_EVAL_ERROR
> Error Message:Error evaluating script (source:DataSet:data.fetch,
> line:5): invalid return (DataSet:data.fetch#5).
> invalid return (DataSet:data.fetch#5)
>
> Has anyone an idea what is wrong here?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.24056 seconds