jrp Posted September 30, 2021 Share Posted September 30, 2021 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 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 30, 2021 Share Posted September 30, 2021 Hello, Please see the related demos. Quote Link to comment Share on other sites More sharing options...
jrp Posted September 30, 2021 Author Share Posted September 30, 2021 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? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 30, 2021 Share Posted September 30, 2021 Hi, OnColumnSummaryTotal. Quote Link to comment Share on other sites More sharing options...
jrp Posted September 30, 2021 Author Share Posted September 30, 2021 Hi Sherzod, What should I do inside OnColumnSummaryTotal to have the total calculated automatically? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 30, 2021 Share Posted September 30, 2021 HI, 1 minute ago, jrp said: What should I do inside OnColumnSummaryTotal to have the total calculated automatically? \FMSoft\Framework\uniGUI\Demos\Desktop\GridGroupingSummaryGrandTotal ? Quote Link to comment Share on other sites More sharing options...
jrp Posted September 30, 2021 Author Share Posted September 30, 2021 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... Quote Link to comment Share on other sites More sharing options...
Wilton Ergon Posted September 30, 2021 Share Posted September 30, 2021 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. Quote Link to comment Share on other sites More sharing options...
jrp Posted September 30, 2021 Author Share Posted September 30, 2021 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.