This topic is locked

column sum

1/6/2023 10:47:55 AM
PHPRunner General questions
francesco author

I have always used column total in page designer to get totals, but now I need to skip negative values in sum. How do I proceed? Is there an example in the manual?
Attached table is a custom view and column name is an alias.

img alt

admin 1/6/2023

This is a job for a custom code snippet. Totals are meant to be calcualted as a sum of all records.

francesco author 1/6/2023

do I have to contact support for a working example? or is there something similar in manual?
I tried this:
https://xlinesoft.com/phprunner/docs/show_order_total_on_the_edit_page_as_the_details_table_is_updated.htm
but doesn't seem to work
An example of JQuery sum on a column could be useful

admin 1/6/2023

We cannot possibly know what doesn't work for you, as you see on the video in the manual that code works as expected.

You need to understand that this example show dynamic totals calcualtion when details are added, edited or deleted. Your original question is about static total calculation, that is calculated once on the initial page load. It is possible to adjust this example to do what you need but I think it will be easier just to use a code snippet.

fhumanes 1/7/2023

Hello,

I think this method can be used to obtain the functionality you require.

https://fhumanes.com/blog/guias-desarrollo/guia-16-phprunner-totales-en-grupo-en-paginas-list/

All you have to do is make the sum on SQL according to what you indicate.

Regards,
fernando

francesco author 1/8/2023

thanks Fernando, on your blog you can always find something useful