#7 Components - TSDBGrid & TSDBGridFooter
Contents
These two components were made for one reason only: to get decent looking footer for the DBGrid.
There are many components in the Delphi world giving DBGrid all sorts of features, but there are a very few that have the ability to show some kind of footer. Furthermore, all of those (well, the ones we could find on the Internet) are either very expensive, or have some "features" we don't like, or don't have all the right things inside.
The perfect solution would be to have a footer component that can attach itself to any DBGrid. However, this is very close to being impossible, so we decided to do the next best thing: a footer component that can be attached to any TCustomDBGrid descendant. And here it is.
With TSDBGridFooter, you can choose the DBGrid component you like most, and use them together. That's why we didn't bother to make "the greatest DBGrid of all", but simply inherited from TDBGrid, and added some code to properly communicate with the footer component. TSDBGrid completely relies on TDBGrid functionality, and it doesn't introduce any new properties. That is why it's so easy to switch to any grid component: just change two lines in SGrid.pas.
If you have purchased the source version of these components, and want to combine the functionality of your favorite DBGrid and our TSDBGridFooter component, you'll need to make these changes:
Properties, methods and events
TSDBGridFooter
Properties:
BevelAllCells
|
determines if all the footer cells should
be beveled, or only the ones with some text inside
|
|
BevelStyle
|
bsLowered,
bsRaised or bsNoBevel for the whole footer
|
|
BevelWidth
|
width
of bevel for the footer
|
|
CellBevelStyle
|
style
of bevel for footer cells
|
|
CellBevelWidth
|
width
of bevel for footer cells
|
|
FooterColumns
|
describes
the properties for each cell
|
|
Grid
|
the
grid to attach to
|
Events:
AfterSumData | this event is triggered after the data in table has been calculated take a look at Operation property in TSFooterColumn | |
OnSumData | this event is triggered before any calculation takes place - in case you want to do custom calculations for the footer results |
TSFooterColumn
Properties:
Color | each cell (column) can have its own color | |||
FieldName | name of the field to attach cell to | |||
Font | font to use for displaying cell text | |||
Operation | it can be one of the following: | |||
opNone | no text inside cell | |||
opAverage | average value for the field | |||
opCount | number of records in grid | |||
opMax | maximum number in the field | |||
opMin | minimum number in the field | |||
opSum | sum of field values | |||
opText | custom text - see Text property | |||
ParentColor | use footer color for the cell | |||
ParentFont | use footer font for the cell text | |||
Text | custom text to display in the cell |
Unzip all the files in the archive to any directory (with -d option, if you use pkunzip) - "C:\My Components", for example. Copy all files from "C:\My Components\Delphi X" to "C:\My Components" (remember to replace "X" with Delphi version you are using).
Start Delphi, open SDBGrid.dpk, compile and close it. Open DCLSDBGrid.dpk, compile, install and close it.
If Delphi complains about not being able to find any .dcu, .dpl, or .bpl, just add ";C:\My Components" to search path (Tools/Environment Options, Library tab, Library Path), or simply copy the file that Delphi is looking for to "C:\Windows\System".
This version (v1.04) is first public release.
There are no known bugs at this time. If you find some bugs, please report to sedlan@ptt.yu, and we will send you source code for free, once the bug is corrected. Please remember to include your email address, otherwise we will not be able to send you the source.
Email address sedlan@ptt.yu is available for all your comments, questions and ideas. If you'd like to see some additional functionality in this component, please contact us.
By registering one or more licenses, you have the right to incorporate these components into as many as you like applications royalty-free.
If you decide to purchase license for this, or any other #7 Component, you will get one year upgrades free of charge. New versions of components will be available to you at significantly lower price after the period of one year (during which you get all new versions for free). You will also receive a phone number for limited technical support.
In case you register the source version of these components, you'll be able to use any DBGrid descendant with TSDBGridFooter.
Visit http://sedlan.tripod.com/products.htm and register online. All major credit cards apply through secure internet protocol. You can also register via fax, international mail order, bank wire, Postcheque, UK Cheque or US Check.
Please read carefully License.txt file before using this software.