Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » iterate over report parameters in javascrips
iterate over report parameters in javascrips [message #368575] Wed, 10 June 2009 22:17 Go to next message
Rafik Jaouani is currently offline Rafik JaouaniFriend
Messages: 43
Registered: July 2009
Member
How do I iterate over report parameters in javascript?

I tried:

for (var i in params) {
...
}

And I got the following error:

java.lang.NullPointerException at
org.mozilla.javascript.ScriptRuntime.enumChangeObject(Script Runtime.java:1916)
at org.mozilla.javascript.ScriptRuntime.enumInit(ScriptRuntime. java:1852)
at
org.mozilla.javascript.gen.c42704._c0(/report/method[@name="initialize "]:1)
at
org.mozilla.javascript.gen.c42704.call(/report/method[@name= "initialize"])
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:393)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2834)
at
org.mozilla.javascript.gen.c42704.call(/report/method[@name= "initialize"])
at
org.mozilla.javascript.gen.c42704.exec(/report/method[@name= "initialize"])
at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:302)
Re: iterate over report parameters in javascrips [message #368583 is a reply to message #368575] Thu, 11 June 2009 21:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.windstream.net

Rafik,

Try something like this:

var ll =reportContext.getDesignHandle().getAllParameters().size();
rp="";
for( var i=0;i<ll;i++){
rpd = reportContext.getDesignHandle().getAllParameters().get(i);
rp = params[rpd.getName()]; //getPromptText();
}


Jason

Rafik Jaouani wrote:
> How do I iterate over report parameters in javascript?
>
> I tried:
>
> for (var i in params) {
> ...
> }
>
> And I got the following error:
>
> java.lang.NullPointerException at
> org.mozilla.javascript.ScriptRuntime.enumChangeObject(Script Runtime.java:1916)
> at
> org.mozilla.javascript.ScriptRuntime.enumInit(ScriptRuntime. java:1852)
> at
> org.mozilla.javascript.gen.c42704._c0(/report/method[@name="initialize "]:1)
> at
> org.mozilla.javascript.gen.c42704.call(/report/method[@name= "initialize"])
> at
> org.mozilla.javascript.ContextFactory.doTopCall(ContextFacto ry.java:393)
> at
> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime .java:2834)
> at
> org.mozilla.javascript.gen.c42704.call(/report/method[@name= "initialize"])
> at
> org.mozilla.javascript.gen.c42704.exec(/report/method[@name= "initialize"])
> at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContex t.java:302)
>
Re: iterate over report parameters in javascrips [message #368593 is a reply to message #368583] Fri, 12 June 2009 14:10 Go to previous message
Rafik Jaouani is currently offline Rafik JaouaniFriend
Messages: 43
Registered: July 2009
Member
Thanks Jason. That worked.
Previous Topic:Displaying a table based on the value of its data elements
Next Topic:BIRT background image is screwed
Goto Forum:
  


Current Time: Thu Apr 25 04:22:45 GMT 2024

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

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

Back to the top