ZEOS 7.2.4 Filter error

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
dev.bt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 11.09.2019, 15:43

ZEOS 7.2.4 Filter error

Post by dev.bt »

I am using that to filter :

Code: Select all

 procedure TNGrid.EditChange(Sender: TObject);
 Var
   En_tete : string; //header name
 begin
  if (Col <> Null) and (Col >= CFix) then
   En_tete := MyDataset.Fields[Col-1].DisplayName;
   if NOT (TEdit(Sender).Text = '') then
   begin
    MyDataset.Filtered:= false;
    MyDataset.Filter:= En_tete+' like ''*'+TEdit(Sender).Text+'*''';
    MyDataset.Filtered:= true;
   end
   else
   begin
    MyDataset.Filtered:= false;
    MyDataset.Filter:='';
   end;
   Filter2();
 end;
I can't filter the last character .
And when the cell contains one char then it does not filter at all. :?:
thanks for your help.
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 766
Joined: 18.11.2018, 17:37
Location: Hungary

Re: ZEOS 7.2.4 Filter error

Post by aehimself »

Hello,

Filtering works just fine from 0 characters up. What I can see is that you are NOT ignoring the case, which means the value "Test" will not show up if you filter "like '%S%'".

Try this:

Code: Select all

MyDataset.Filter := En_tete + ' like LOWER(''*' + String(TEdit(Sender).Text).ToLower + '*'')';
There is a really nice document what describes what "functions" you can use in a query filter:
https://sourceforge.net/projects/zeosli ... mentation/
and download "ZExpression.pdf"
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
dev.bt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 11.09.2019, 15:43

Re: ZEOS 7.2.4 Filter error

Post by dev.bt »

i will try it.
dev.bt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 11.09.2019, 15:43

Re: ZEOS 7.2.4 Filter error

Post by dev.bt »

the result of ShowMessage(MyDataset.Filter); is : NOM like LOWER('*a*') // NOM is the header of the Column.

All records with an 'a' will show unless it ends with an 'a' or the cell squals an 'a' then it doesn't filter.
it's like as if it doesn't read the last char at all (IsMatch or the LIKE Operator).
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Re: ZEOS 7.2.4 Filter error

Post by marsupilami »

Hello,

I think this might be the same problem as in our Ticket #369.
Best regards,

Jan
dev.bt
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 11.09.2019, 15:43

Re: ZEOS 7.2.4 Filter error

Post by dev.bt »

Absolutely true.i have to solve the problem as quickly as possible.
Thanks anyway.
Post Reply