Page 1 of 1

Sum of all pages in List Page

Posted: Wed Sep 15, 2021 3:36 pm
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)


Re: Sum of all pages in List Page

Posted: Wed Sep 15, 2021 3:49 pm
by mobhar

You may create a Report from your PHPMaker project.


Re: Sum of all pages in List Page

Posted: Wed Sep 15, 2021 4:12 pm
by nehir_nehir

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


Re: Sum of all pages in List Page

Posted: Sun Oct 02, 2022 2:01 am
by DavidLi

Some solution? This functionality would help me a lot.


Re: Sum of all pages in List Page

Posted: Sun Oct 02, 2022 10:43 am
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 ......");
}