Skip to main content



      Home
Home » Archived » BIRT » onFetch local javascript variable
onFetch local javascript variable [message #902795] Mon, 20 August 2012 09:26 Go to next message
Eclipse UserFriend
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
Eclipse UserFriend
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: Thu May 15 15:14:37 EDT 2025

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

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

Back to the top