Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 10:46

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Issues in Lazarus
PostPosted: 11 Aug 2020, 12:21 
Offline

Joined: 11 Jul 2019, 12:56
Posts: 18
Hello, I am having some issues in Lazarus that I want to point out.

1. Whenever I enter edit mode on some field in TDbGridEh that for example has field size 8. And afterwards I try to edit another field that has a size of 20. The entire text would be cut to the size of 8. Like it remembers the size of the previous field and then applies it to the current field. This issue does not happen in Delphi 7, nor does it happen in standard Lazarus TDBGrid.

2. Until Lazarus version of 2.0.10 and free pascal version 3.2, Lazarus had an issue with TStringField holding Latin characters (šđčćž) that take 2 bytes per characters. So for example if we have a field that has a size of 20 and populate it with Latin characters that take 2 bytes , only half of them would be saved to database. They show ok while I am still in edit mode in TDbGridEh on some field. But as soon as data gets posted, it gets cut out. Lazarus own TDBGrid also had this issue until version 2.0.10, but this was fixed in free pascal 3.2.
To go around this issue I was forced to use this procedure:
Code:
procedure TForm1.SQLDataDriverEh1BuildDataStruct(DataDriver: TDataDriverEh;
                                                 DataStruct: TMTDataStructEh);
var
  sField: TMTStringDataFieldEh;
begin
  DataDriver.DefaultBuildDataStruct(DataStruct);
  sField := TMTStringDataFieldEh(DataStruct.ChangeFieldType('KLA_NAZ', TMTStringDataFieldEh));
  sField.StringDataType := fdtWideStringEh;
end;


3. When using CTRL+V to paste data into some field in TDBGridEh, Data gets pasted twice.

4.Custom filter in TDBgridEh, when using TDate = some value I get an error (Index based on unknown field "=")

Thank you!


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 18 Aug 2020, 02:40 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

I created simple App with fields size 8 and 20.
When I entered text into the DBGridEh column values, I didn't have any problem with the text being entered.
Attachment:
sshot-135.png
sshot-135.png [ 34.14 KiB | Viewed 2099 times ]


Quote:
2. Until Lazarus version of 2.0.10 and free pascal version 3.2, Lazarus had an issue with TStringField holding Latin characters (šđčćž) that take 2 bytes per characters.

It is not clear who and what should be corrected.
If the fixes have already been made to the FPC, then all LCL controls (including DBGridEh) should work automatically.

Quote:
3. When using CTRL+V to paste data into some field in TDBGridEh, Data gets pasted twice.

Yes. We will fix it at the next build.

Quote:
4.Custom filter in TDBgridEh, when using TDate = some value I get an error (Index based on unknown field "=")


Looks like FPC in method TBufDatasetParser.ParseExpression doesn't support filters for TDate fields.
We tested next expression: DataSet.Filter := 'DateField3=''18.08.2020''';
Do you know how to write filter expressions for TDate fields?
We don't know how.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 21 Aug 2020, 07:19 
Offline

Joined: 11 Jul 2019, 12:56
Posts: 18
EhLibSupport wrote:
Hello
I created simple App with fields size 8 and 20.
When I entered text into the DBGridEh column values, I didn't have any problem with the text being entered.
Attachment:
The attachment sshot-135.png is no longer available

I haven't explained very well, sorry!
The problem is when I "enter" those fields. If I first enter the field that has the size of 8, the data gets selected properly. But if I afterwards "enter" a filed that has a size of 20 only 8 characters will be selected and the rest would not be shown. ( I have attached 2 screenshots that show this)




Quote:
Looks like FPC in method TBufDatasetParser.ParseExpression doesn't support filters for TDate fields.
We tested next expression: DataSet.Filter := 'DateField3=''18.08.2020''';
Do you know how to write filter expressions for TDate fields?
We don't know how.

This is the expression that should be used:
Filtering is similar - note: apparently you need to surround the string value you are comparing against with double quotes. See below for details on the DTOS function; basically you need to format the date as YYYYMMDD:
// we have a field named MODIFIED here:
MyDBF.Filter:='DTOS(MODIFIED) > "20051231"';

// if you want to compare datetime, that can be done:
// everything later than 2 January 2006, 4:34PM
MyDBF.Filter:='DTOS(MODIFIED) > "20060102 163400"';

MyDBF.Filtered:=true;

Best Regards!


Attachments:
File comment: After
Screenshot_2.png
Screenshot_2.png [ 95.06 KiB | Viewed 2082 times ]
File comment: Before
Screenshot_1.png
Screenshot_1.png [ 95.89 KiB | Viewed 2082 times ]
Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 31 Aug 2020, 02:06 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

We fixed the error with the Size in the EhLib.VCL 9.5 Build 9.5.027.
Check, please.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 01 Sep 2020, 13:43 
Offline

Joined: 11 Jul 2019, 12:56
Posts: 18
EhLibSupport wrote:
Hello

We fixed the error with the Size in the EhLib.VCL 9.5 Build 9.5.027.
Check, please.


Hello,

I have checked the error with Size, and confirm that it is now fixed.

Were the information about filtering by date that I provided you with helpful?


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 01 Oct 2020, 09:44 
Offline

Joined: 11 Apr 2019, 13:38
Posts: 2
EhLibSupport wrote:

Looks like FPC in method TBufDatasetParser.ParseExpression doesn't support filters for TDate fields.
We tested next expression: DataSet.Filter := 'DateField3=''18.08.2020''';
Do you know how to write filter expressions for TDate fields?
We don't know how.


Can you try using this filter expression?
DataSet.Filter := 'DTOS(DateField3) = ''20200818'''


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 01 Oct 2020, 09:45 
Offline

Joined: 11 Apr 2019, 13:38
Posts: 2
EhLibSupport wrote:
Looks like FPC in method TBufDatasetParser.ParseExpression doesn't support filters for TDate fields.
We tested next expression: DataSet.Filter := 'DateField3=''18.08.2020''';
Do you know how to write filter expressions for TDate fields?
We don't know how.


Can you try using this filter expression?
DataSet.Filter := 'DTOS(DateField3) = ''20200818'''


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 24 Oct 2020, 03:54 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

We fixed problem with Filter Date, DateTime fields in EhLib.VCL 10.0 Build 10.0.025
Please check.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
 Post subject: Re: Issues in Lazarus
PostPosted: 02 Nov 2020, 10:03 
Offline

Joined: 11 Jul 2019, 12:56
Posts: 18
It works now. Thank you!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 62 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group