This topic is locked
[SOLVED]

 Report - re-use system calculated fields

1/7/2015 9:32:51 AM
PHPRunner General questions
G
GregJ author

How can I re-use the system created report variables 'global_totalbillhours_sum' and 'global_totalexphours_sum' to give me a total of the two in a third homemade snippet 'event TotTime'?

Sergey Kornilov admin 1/7/2015

In Report BeforeDisplay event you can access those variables as $xt->getvar("global_totalbillhours_sum") and $xt->getvar("global_totalexphours_sum").
Insert a new template variable somewhere on report page as {$mytotal} and then in BeforeDisplay event use something like this:

$xt->assign("mytotal",$xt->getvar("global_totalbillhours_sum") + $xt->getvar("global_totalexphours_sum"));
G
GregJ author 1/7/2015

I never would have figured that out. Works perfectly!
Thanks Sergey.