Topic: how to get total sum on grid footer with sql query button

Hi,

I created a yerterday button with sql query settings.
When click on yerterday button it shows the records of yerterday.

How can i get total sum on grid footer?

test app attached

Post's attachments

Attachment icon TEST.rar 2.5 kb, 495 downloads since 2016-12-21 

Re: how to get total sum on grid footer with sql query button

Hello Kkalgidim,
You can define your tablegrid as normal with the columns you wish to see and any column totals. 
Your 'sql query' uses this definition to display the output and the totals will be shown as specified (see 'yesterday sql query' in the attachment).
Instead of an 'sql query', you could just use a simple 'search' (see 'yesterday search calendar' in the attachment);  this gives you flexibility to see expenditure for any day (not just yesterday).
I hope this helps.
Derek.

Post's attachments

Attachment icon kkal.zip 674.58 kb, 576 downloads since 2016-12-21 

Re: how to get total sum on grid footer with sql query button

Thank you Derek
Calendar clicl version is really useful but i want to create buttons like

yesterday
last week
last month

is it possible to make it on calendar version?

Re: how to get total sum on grid footer with sql query button

i am using version 1.49
when i use sum on grid settings it does not appear!

Bu latest version it appears

Re: how to get total sum on grid footer with sql query button

kkalgidim
I have added footer in your project, also added button last week and last month.

Post's attachments

Attachment icon TEST_fixed.zip 3.95 kb, 631 downloads since 2016-12-22 

Dmitry.

Re: how to get total sum on grid footer with sql query button

I downloaded  latest minor update ver 1.52
Problem fixed on this version . So i did not use function for total sum. I used grid setting for it.

For date intervals i used 2 calendar object with >= and <= filter
so i am getting result between 2 date filed
Also i used buttonf for practical use as yerterday, last week, last month.

Thanks for your help Derek and Dmitry

Re: how to get total sum on grid footer with sql query button

Hello all,


I had a look with great interest to the example posted by Dmitry and I noticed the

Form1.TableGrid1.Columns[3].Footer.FormulaKind := fkSum;

in the code.


I was wondering Dmitry, are there other Formulakind we can use like this and how are they named ?


fkCount
fkAverage
fkMaximum
fkMinimum
fkDistinct


Is this correct ?


Cheers



Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: how to get total sum on grid footer with sql query button

mathmathou
There is no more formulas, only listed above

Dmitry.

9 (edited by boulenajm 2018-03-07 16:35:49)

Re: how to get total sum on grid footer with sql query button

How do you read (get) the value of the footer columns?

Got it smile Thanks...


frmMain.TableGrid3.Columns[0].Footer.Caption

Re: how to get total sum on grid footer with sql query button

property Caption return string, another way to get float value

Form1.TableGrid3.Columns[0].Footer.FormulaValue
Dmitry.