

Here is my first component!

It is a replacement for the standard SQL component.  It has all original functionality still there, but has 2 new methods, and 1 new property.

It is used to provide a generic filter pop up screen for the SQL statement.  How often have you designed a quickreport only to be asked by the user for filtering functionality ?

Well here is is.  All you have to do is call the method 'Filter', and a pop up dialog box will appear, with each field (as designed in the fields editor), and options to select :

1) all values
2) only these values (a list you can type in)
3) not these values (a list you can type in)
4) Less than (an edit field)
5) Greater than (an edit field)
6) both less and greater than (the 2 above edit fields)

It rebuilds the sql statement so that all client server functionality is kept, and works with any sql statement you can type in, including 'where's and 'order by's.

And its free!

There are 6 files

1) Readme.TXT		this file you are reading
2) FiltAbt.dcu		About Box Compiled Unit
3) FiltForm.dcu		Pop Up Form Compiled Unit
4) FiltQry.dcu		Main Component Compiled Unit
5) FiltAbt.dfm		About Box Form
6) FiltForm.dfm		Pop Up Form

Copy all (execpt the readme) to your components directory, and install the 'FiltQry.DCU' file.

Works like a breeze, just add the SQL component to the form as you would normally, and connect to a database with a statement like select * from tablename.  

Add a datasource, a dbgrid, and connect them up.  

Then add a button with the 1 line of code : (ComponentName).Filter;  A box will pop up with each field in the Table.  You may then filter the fields as you like.

To test the SQL, try this code:
MessageDlg((ComponentName).SQL.Text,MtInformation,[MbOk],0);
(ComponentName).Filter;
MessageDlg((ComponentName).SQL.Text,MtInformation,[MbOk],0);

you should see the before and after sql statements.

To unfilter the Component, call the unfilter method.

To change the Window Name on the Filter dialog box, change the DisplayName property

If you set field properties (such as visible and Display Name) these will be used

good luck and have fun

any comments, requests, winges, or so forth, please get back to me

david todd

davetodd@starwon.com.au

cheers