Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » onFetch local javascript variable
onFetch local javascript variable [message #902795] Mon, 20 August 2012 09:26 Go to next message
sam detweiler is currently offline sam detweiler
Messages: 18
Registered: August 2012
Junior Member
I have a datasource that uses javascript to update an array of records processed which is used as an input filter on another datasource.

I want to further control the data put into the array, by using some additional javascript..

but I don't understand how to get local variables in the onFetch script.

var varname = "";
and
varname ="";

both produce errors.

what I need to do is check the length of the data returned on one of the fetched rows.

var xyz= row[data_element];
if xyz.length()>0
array.push(xyz);

but line one fails with error

error evaluating script "var xyz=";
Re: onFetch local javascript variable [message #902865 is a reply to message #902795] Mon, 20 August 2012 14:47 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Do you have the column name in quotes? Log out your fetch like:

importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/test/ds.txt", true ) );
out.println( "row value "+ row["ORDERNUMBER"]);
out.close();

Jason

On 8/20/2012 9:26 AM, sam detewiler wrote:
> I have a datasource that uses javascript to update an array of records
> processed which is used as an input filter on another datasource.
>
> I want to further control the data put into the array, by using some
> additional javascript..
>
> but I don't understand how to get local variables in the onFetch script.
>
> var varname = "";
> and
> varname ="";
>
> both produce errors.
> what I need to do is check the length of the data returned on one of the
> fetched rows.
>
> var xyz= row[data_element];
> if xyz.length()>0 array.push(xyz);
>
> but line one fails with error
>
> error evaluating script "var xyz=";
>


Jason Weathersby

BIRT Exchange
Previous Topic:BIRT CHART
Next Topic:How to make cross-tables HTML smaller
Goto Forum:
  


Current Time: Wed Apr 23 17:46:41 EDT 2014

Powered by FUDForum. Page generated in 0.01638 seconds