Skip to main content



      Home
Home » Archived » 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] Thu, 03 November 2011 22:47 Go to next message
Eclipse UserFriend
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 13:17 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Set Value in Dynamic Text depending on other field values [message #754922 is a reply to message #754872] Fri, 04 November 2011 23:39 Go to previous messageGo to next message
Eclipse UserFriend
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 15:14 Go to previous message
Eclipse UserFriend
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: Tue Jul 22 23:50:08 EDT 2025

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

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

Back to the top