Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Set Value in Dynamic Text depending on other field values(Dynamic Text value = difference between two aggregate fields)
Set Value in Dynamic Text depending on other field values [message #754723] Fri, 04 November 2011 02:47 Go to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear All,

I have a table bound to a dataset. I have two numeric columns in the table that I sum up using aggregate fields at the end of the table. The ids of the aggregate fields are for example: fldAgg1 and fldAgg2.

I have a dynamic text below the table. I want to display the difference in values between the two aggregate fields in the dynamic text.

Could anyone please please advise me the most suitable way to carry this out?

Thanking you in advance.. Razz

Karvesh
Re: Set Value in Dynamic Text depending on other field values [message #754872 is a reply to message #754723] Fri, 04 November 2011 17:17 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1595
Registered: July 2009
Senior Member

If I'm understanding correctly, you could store both values into persistent global variables and then recall them in your dynamic text box to do your computation. Or, since both are bindings in your table, you could do the computation in your table script, then store the value in a PGV and recall this value in your text box. Hope this helps.

Regards,

Michael
http://www.birt-exchange.org


Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Set Value in Dynamic Text depending on other field values [message #754922 is a reply to message #754872] Sat, 05 November 2011 03:39 Go to previous messageGo to next message
karvesh ghunsam is currently offline karvesh ghunsam
Messages: 95
Registered: July 2011
Member
Dear Michael,

thanks for the tip. I will try the option of computation in the table script. Yet, how can i access the values of fields using their id?
Is there a way to get it by handlers?
Re: Set Value in Dynamic Text depending on other field values [message #755260 is a reply to message #754922] Mon, 07 November 2011 20:14 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You do not access them using their id. If you do this in the table
bindings, just create a new binding and put in an expression like:


var diff = row["aggr1"] - row["aggr2"]
reportContext.setGlobalVariable("mydiff", diff);
diff;

then in the dynamic text put in the expression like:

reportContext.getGlobalVariable("mydiff");

Jason


On 11/4/2011 11:39 PM, karvesh wrote:
> Dear Michael,
>
> thanks for the tip. I will try the option of computation in the table
> script. Yet, how can i access the values of fields using their id?
> Is there a way to get it by handlers?
Previous Topic:Rebranding the RCP Version of the BIRT Report Designer?
Next Topic:(no subject)
Goto Forum:
  


Current Time: Sun Sep 21 14:10:03 GMT 2014

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

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