Re:Total fields in DBGrid?
On Tue, 07 Jul 1998 22:31:10 -0600, Alan Sisson <asis...@novatel.ca>
wrote:
Quote
>Greetings!
>I am wondering if anyone has come up with an easy way to create a totals
>line in a DBGrid component. The only way I can get it to provide totals
>is by placing another DBGrid and using an additional query to gather the
>totals.
>Ideally, if the DBGrid component allowed a footer where totals of the
>columns could be placed it would be perfect.
>Any ideas would be appreciated...
>Alan Sisson
What I've usually done (though it looks different than what you want)
is to put the grid on a form and under the appropriate columns of the
grid, on the form, I've put TLabels which I use to display the totals.
If you use the grid in data-aware mode, then each row corresponds with
a record in the database so there won't be a record to associate with
the total. You can write your own code to use a non-data aware grid
which won't be too hard if you aren't allowing updates or edits. You
could then add the row in code.
Steve F (Team B)