Page 1 of 1

TCRDBGrid filter bar <>* not running.

Posted: Mon 30 Jan 2012 09:20
by zguven
Hi,

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

Thanks.

Posted: Mon 30 Jan 2012 11:33
by AlexP
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.

Posted: Mon 30 Jan 2012 11:43
by zguven
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

Posted: Mon 30 Jan 2012 14:20
by AlexP
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.

Posted: Mon 30 Jan 2012 15:02
by zguven
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?

Posted: Tue 31 Jan 2012 06:58
by zguven
How to get empty records?

Waiting for reply from you.

Posted: Tue 31 Jan 2012 10:07
by AlexP
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, '''');

Posted: Wed 01 Feb 2012 09:31
by zguven
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.

Posted: Wed 01 Feb 2012 11:23
by AlexP
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