Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » onFetch local javascript variable
onFetch local javascript variable [message #902795] Mon, 20 August 2012 13:26 Go to next message
sam detweiler is currently offline sam detweilerFriend
Messages: 22
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 18:47 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
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=";
>
Previous Topic:BIRT CHART
Next Topic:How to make cross-tables HTML smaller
Goto Forum:
  


Current Time: Tue Oct 08 20:25:26 GMT 2024

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

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

Back to the top