Sum of all pages in List Page

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
nehir_nehir
User
Posts: 31

Sum of all pages in List Page

Post by nehir_nehir »

We can get the sum of the fields with Aggregate in the List page. But this is for the current page. I want to show the sum of all pages under this page total. How can I show the sum of all records from that page with the current filter?

I also get the difference of the sums with Javascript. Is there a more practical method? (The total difference of the two fields taken with Aggregate)


mobhar
User
Posts: 11660

Post by mobhar »

You may create a Report from your PHPMaker project.


nehir_nehir
User
Posts: 31

Post by nehir_nehir »

The report page is not suitable for me. I need to use master-detail tables and list page features.


DavidLi
User
Posts: 13

Post by DavidLi »

Some solution? This functionality would help me a lot.


arbei
User
Posts: 9288

Post by arbei »

You may use the List Page -> Aggregate feature, it is only for aggregates of the current page, but you may use Row_Rendered server event to calculate the sums yourself, e.g.

if ($this->RowType == ROWTYPE_AGGREGATE) {
    $this->MyField->Total = ExecuteScalar("SELECT SUM(MyField) FROM MyTable WHERE ......");
}

Post Reply