TCRDBGrid filter bar <>* not running.

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zguven
Posts: 21
Joined: Mon 05 May 2008 19:39

TCRDBGrid filter bar <>* not running.

Post by zguven » Mon 30 Jan 2012 09:20

Hi,

I am using 8.1.4 for RAD Studio XE2.
TCRDBGrid filter bar * not running. Please help.

Thanks.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 30 Jan 2012 11:33

Hello,

In the filter, the * symbol without quotation marks stands for a sequence of any symbols. Under your '*' condition, you will always obtain an empty dataset. Please specify the result of filter appliance you need, and we will try to help you with your problem.

zguven
Posts: 21
Joined: Mon 05 May 2008 19:39

Post by zguven » Mon 30 Jan 2012 11:43

Running version 6.10 with Delphi 7 without any problem.
But this version with XE2 not running.

I need your help.

Similar problem :
http://www.devart.com/forums/viewtopic.php?t=19564

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 30 Jan 2012 14:20

Hello,

What do you mean by "with XE2 not running"?
As I have written in the topic you mentioned, the previous behaviour was wrong. In the current version, the filter works correctly for all the versions of Delphi.

P.S. Please make an example of the source and filtered data in both IDEs.

zguven
Posts: 21
Joined: Mon 05 May 2008 19:39

Post by zguven » Mon 30 Jan 2012 15:02

I have a project.
Written delphi7 using odac version 6.10.
Users can use TCRDBGrid Filter Bar '*' for get empty records.

I want to migrate this project from Delphi 7 to Delphi XE2.
Using latest odac vesion 8.1.4
TCRDBGrid Filter Bar '*' not running.


Users use '*' for get empty records.

How to get empty records?

zguven
Posts: 21
Joined: Mon 05 May 2008 19:39

Post by zguven » Tue 31 Jan 2012 06:58

How to get empty records?

Waiting for reply from you.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 31 Jan 2012 10:07

Hello,

We have fixed the bug with the Null values filtering in CRDBGrid, this fix will be included in the next version of the product. At present, you can fix the CRDBGrid.pas module by yourself, changing the following

change

Code: Select all

else
  Result := Field.FieldName + Sign + AnsiQuotedStr(ConstStr, '''');
to

Code: Select all

else
  if (Trim(ConstStr) = '''''') or  (Trim(ConstStr) = '""') then
    Result := Field.FieldName + Sign + 'null or ' + Field.FieldName + Sign + ''''''
  else
    Result := Field.FieldName + Sign + AnsiQuotedStr(ConstStr, '''');

zguven
Posts: 21
Joined: Mon 05 May 2008 19:39

Post by zguven » Wed 01 Feb 2012 09:31

We are working more than one column.
Only when a column is working properly.
When we try more than one column, the other filters do not work.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Wed 01 Feb 2012 11:23

Hello,

Thank you for the information. For correct filter on multiple fields, in the code I brought you, replace the string

Code: Select all

Result := Field.FieldName + Sign + 'null or ' + Field.FieldName + Sign + ''''''
to
Result := '(' + Field.FieldName + Sign + 'null or ' + Field.FieldName + Sign + ''''')'
and in this same method before the string

Code: Select all

 case Field.DataType of
add string

Code: Select all

    if (UpperCase(Trim(ConstStr))  'NULL') or (Field.DataType in [ftString,ftWideString]) then
After this, for searching empty and Null strings, you should type =[]''. For searching Null values in the fields of other types (not String), type =[]Null

Post Reply