Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » getting Data Element value in onCreate event(getting Data Element value in onCreate event and assign to a global variable)
getting Data Element value in onCreate event [message #777893] Wed, 11 January 2012 00:49 Go to next message
Madhana Gopal is currently offline Madhana Gopal
Messages: 2
Registered: January 2012
Junior Member
Hi All,

I am new to Eclipse BIRT. I want to get the data element value in onCreate event of this element and assign to a global variable. Also i would like to access the value of this global variable in beforeRender event of the Report.

I have tried several ways but no luck.

Please help me out.

Thanks & Regards
Madhan
Re: getting Data Element value in onCreate event [message #778400 is a reply to message #777893] Wed, 11 January 2012 12:31 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are previewing in the designer the beforeRender event will fire
before the oncreate events for data elements. If you preview using the
web viewer it will fire like you want it to. In the oncreate use:

reportContext.setGlobalVariable("myvar",this.getValue());
or
reportContext.setPersistentGlobalVariable("myvar",this.getValue());

and in the beforeRendering

var tst = reportContext.getGlobalVariable("myvar");
or
var tst = reportContext.getPersistentGlobalVariable("myvar");

See :
http://www.eclipse.org/birt/phoenix/deploy/reportScripting.php

for details on event order.

Jason


On 1/11/2012 12:49 AM, Madhana Gopal wrote:
> Hi All,
>
> I am new to Eclipse BIRT. I want to get the data element value in
> onCreate event of this element and assign to a global variable. Also i
> would like to access the value of this global variable in beforeRender
> event of the Report.
>
> I have tried several ways but no luck.
>
> Please help me out.
>
> Thanks & Regards
> Madhan
Previous Topic:Dynamic watermarks using parameters
Next Topic:Text Overflow to another cell
Goto Forum:
  


Current Time: Thu Jul 24 19:01:05 EDT 2014

Powered by FUDForum. Page generated in 0.01560 seconds