Jump to content

How to show the total (summary) of a column of UniDBGrid?


jrp

Recommended Posts

Hello,

I want to show the total of a column of UniDBGrid.

On the UniDBGrid, I have set:
Summary.Enabled:=true;
Summary.GrandTotal:=true;

And on the column I have set:
ShowSummary:=true;

But nothing displayed. How to do it correctly?

Thank you

Link to comment
Share on other sites

Hi Sherzod,

I am looking at the demo, the total is calculated manually in the OnColumnSummary.

I think by setting UniDBGrid.GrandTotal:=true, then the total would be calculated automatically.

What should I do to have it calculated automatically?

Link to comment
Share on other sites

Ah, now I think I get it... the purpose of UniDBGrid.Summary.GrandTotal property is just to provide additional row to show the grandtotal.

But all the calculations have to be done manually.

I'm a bit disappointed because UniGUI is a good framework, but now in 2021 we still have to calculate column total manually...

Link to comment
Share on other sites

1 hour ago, jrp said:

Ah, agora acho que entendi ... o objetivo da propriedade UniDBGrid.Summary.GrandTotal é apenas fornecer uma linha adicional para mostrar o grandtotal.

Mas todos os cálculos devem ser feitos manualmente .

Estou um pouco desapontado porque o UniGUI é um bom framework, mas agora em 2021 ainda temos que calcular o total da coluna manualmente ...

I see it differently, this feature gives me total freedom in how the column calculation will be done, as a simple sum is not always enough.

Link to comment
Share on other sites

Hi wilton_rad,

Of course the total freedom to do column calculation is a good thing. But what comes as a default behavior is also important.

Let the grid to do simple sum calculation by default (if the user wants it to calculate the total) and display it using simple format string (with a property like SummaryFormatString). And if this not enough, then we have OnColumnSummary, OnColumnSummaryResult and OnColumnSummaryTotal for greater freedom.

So we have a good default behavior; and also a good advanced mechanisms if the default behaviour is not enough.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...