This topic is locked

Calculated display field on report

10/5/2010 12:11:22 PM
PHPRunner General questions
E
elliespotter author

Hi, this one has got me stumped!
Is there a way using a php snippet to add a field on a report line that calculates according to the value of a session variable.
I am trying to calculate a daily recommended calorific input which varies according the the reader's age, weight and gender (both held as session variables) and also upon activity levels and other factors held in reported tables.
In the html report is see display fields {$weight_factor_value},{$age_factor_value} & {$gender_value} and would like to access the underlying variables to calculate on them.
Is this possible, or do I need to step back away and think of a different approach?
Kind regards,

Alex

J
Jane 10/6/2010

Hi,
to change values on the list page dynamically you need to use List page: After record processed event on the Eventstab. Field values are in the $data array and all controls are in the $record array.
Unfortunately there is no easy way to apply the same on the report because there are no such events for the reports.

E
elliespotter author 10/6/2010



Hi,
to change values on the list page dynamically you need to use List page: After record processed event on the Eventstab. Field values are in the $data array and all controls are in the $record array.
Unfortunately there is no easy way to apply the same on the report because there are no such events for the reports.


Hi Jane,
Yes, eventually, I concluded that this was the case and now calculate the outputs when the user records their weight (using the beforeAdd and beforeEdit events)so the outputs are now held on the database and can be reported on directly.
Maybe a future enhancement? Along with allowing PHPRunner views as input tables for reports (my client's hosting company does not allow views on the localhost mySql server and they are reluctant to change)?
Kind regards,

Alex

A
ann 10/6/2010

Alex,
thank you.

I've added this feature to our suggestions list.