Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Persistent variables in BIRT scripts
Persistent variables in BIRT scripts [message #1006487] Thu, 31 January 2013 08:36 Go to previous message
donino donino is currently offline donino donino
Messages: 72
Registered: July 2011
Member
Hi,

I am not sure how to use correctly vars[]: with BIRT 4.2.1, i noticed when we create a new var in the "Variables" section, if we set it with some "onCreate" script:

vars["myVar"]="myValue"


Then in a "onRender" script, vars["myVar"] will not be defined, it does not look persistent. But if we set it like this in "onCreate":

reportContext.setPersistentGlobalVariable("myVar","myValue");


This time, in a "onRender" script, vars["myVar"] is equals to "myValue".

Since it is more friendly to drag and drop "myVar" from Variables section than writing reportContext.getPersistentGlobalVariable("myVar") in a render expression, i wonder if we can rely on this behavior:

When we add a new variable in "Variables" eclipse designer section, does "setPersistentGlobalVariable" refer to this variable, or is it just a side-effect (may be a bug) which could change in a future version?

Thanks!


[Updated on: Thu, 31 January 2013 08:38]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic:How to localize currency symbols in BIRT in the web application?
Next Topic:How to get the report "Layout preference" with engine API
Goto Forum:
  


Current Time: Sat May 25 01:18:04 EDT 2013

Powered by FUDForum. Page generated in 0.01760 seconds