This topic is locked

Totals Column on Vertical Layout

6/30/2009 10:22:56 AM
PHPRunner General questions
hfg author

Is there a way to add a totals (or averages) column to a list page when using the vertical layout?
A related question, is there a way to have the field names only show once per row on the vertical layout?
I searched for an answer and did not find anything, but I apologize if there is a post out there already.
Thanks

J
Jane 7/1/2009

Hi,
unfortunately there is no total section for vertical layout.

You can calculate total manually using List page: After record processed event and then show it in the List page: Before display event.
I'm not sure that I understand your question.

Please clarify it.

hfg author 7/1/2009

Thanks for looking at this Jane
Can you give me a generic formula for the event to calculate the total?
For example if the field name was Net_Income
Also, how would I get the result to show on the List page (variable, etc)?
On my 2nd question. Right now the vertical list page looks a bit like this (where the field name is reproduced for every record):
Company ABC Co Company YZX Co

Income $2000 Income $10

Expenses $1000 Expenses $6

Net Income $1000 Net Income $4
I would like this (were the field name only shows once per "row"):
Company ABC Co YZX Co Total

Income $2000 $10 $2010

Expenses $1000 $6 $1006

Net Income $1000 $4 $1004
I hope that clarifies it, thanks

J
Jane 7/1/2009

Hi,
declare new session variable in the List page: Before process, then sum field values in theList page: After record processed event:

$_SESSION["customtotal"]+=$data["FieldName"];



Then assign it in the List page: Before display event:

$xt->assign("customtotal",$_SESSION["customtotal"]);


You can add {$customtotal} in any place on the list page on the Visual Editortab.
Regarding the second question.

Just remove column with labels in the second column with records.

hfg author 7/1/2009

Thanks again Jane
The Totals are working great, thanks
I need a bit more help with the layout though. Not sure I understand this part:

Regarding the second question.

Just remove column with labels in the second column with records.


I have my "Records per row" set to 3, but on the Visual Editor page there is only one column of records.
I tried putting a table before > {BEGIN grid_block}


This resulted in my new table being above the rest of the data, not inline with it.
I was trying to end up with something like this (revised)
Totals Records Name Record1 Record2 Record3
Is this possible?
Thanks again for the help.

J
Jane 7/2/2009

Hi,
unfortunately you can't remove labels for second and third columns in PHPRunner 5.1.

hfg author 7/2/2009

Thanks for the reply.
Something that might help my project if it is possible (and I know it is a big if) to to compare rows.
So it would look something like this (non-verital layout)
Row1

Row2

Difference between rows 1 & 2

Row3

Difference between rows 2 & 3

Row4

Difference between rows 3 & 4
It might look like this
Company - Net Income

ABC - 400

XYZ - 200

Diff - 200 (comment difference between ABC and XYZ)

RTT- 500

Diff - 300 (comment difference between XYZ and RTT)

YTR - 1100

Diff - 600 (comment difference between RTT and YTR)
I have no idea if this is even possible

J
Jane 7/3/2009

Hi,
it's possible. But this task requires a lot of custom coding.

In general you need to edit HTML code on the Visual Editor tab, add new row for totals, then check values for each row in the After record processed event and assign values for Total row.

Unfortunately we don't have a ready to go solution for this.