Date field with null value ==> 30-12-1899 on report print
Date field with null value ==> 30-12-1899 on report print
I'm using IBDAC 3.0.0.4 on D7 width QuickReport from delphi pack.
I have table with date field. If record has null value in this date field, on report printed I have 30-12-1899.
In MySQL DAC forum is similar topic
http://www.devart.com/forums/viewtopic.php?t=9591
What can I do width this. This is a problem for me.
Can you implement described futere in the IBDAC?
regards
Mariusz
I have table with date field. If record has null value in this date field, on report printed I have 30-12-1899.
In MySQL DAC forum is similar topic
http://www.devart.com/forums/viewtopic.php?t=9591
What can I do width this. This is a problem for me.
Can you implement described futere in the IBDAC?
regards
Mariusz
-
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
This is a dataset problem. Are you familiar with persistent fields and calculated fields?
For example if your field is called MyDate
You create a calculated field called CalcMyDate of fieldtype Date.
Then in your dataset's onCalc event, you say:
begin
Fieldbyname('CalcMyDate').value := Fieldbyname('MyDate').value;
if Fieldbyname('MyDate').isnull then fieldbyname('CalcMyDate').clear;
end;
Now, if that doesn't work, you go and make CalcMyDate a calculated field of type string. This way you always give it a string, such as ''
Then this is your OnCalc event:
begin
Fieldbyname('CalcMyDate').AsString := Fieldbyname('MyDate').AsString;
if Fieldbyname('MyDate').isnull then fieldbyname('CalcMyDate').AsString = '';
end;
For example if your field is called MyDate
You create a calculated field called CalcMyDate of fieldtype Date.
Then in your dataset's onCalc event, you say:
begin
Fieldbyname('CalcMyDate').value := Fieldbyname('MyDate').value;
if Fieldbyname('MyDate').isnull then fieldbyname('CalcMyDate').clear;
end;
Now, if that doesn't work, you go and make CalcMyDate a calculated field of type string. This way you always give it a string, such as ''
Then this is your OnCalc event:
begin
Fieldbyname('CalcMyDate').AsString := Fieldbyname('MyDate').AsString;
if Fieldbyname('MyDate').isnull then fieldbyname('CalcMyDate').AsString = '';
end;
I'm after e-mail discussion with your support team, and I see, that the problem is realy not related with IBDAC. (for example, dbExpress behavior is same).
My problem has occured, when QRDBText components has the mask properties set. Emptying this properties field "solve" my problem. Same situation occur with FastReport (without mask properties, FastReport represent null's as zero's).
Maybe, the problem realy is with dataset. I don't know.
best regards
M.
My problem has occured, when QRDBText components has the mask properties set. Emptying this properties field "solve" my problem. Same situation occur with FastReport (without mask properties, FastReport represent null's as zero's).
Maybe, the problem realy is with dataset. I don't know.
best regards
M.
Re: Date field with null value ==> 30-12-1899 on report print
You can do one thing.... If the issue with Fast report means, do the following steps.
1. Right click on the field (Date Field)
2. Hide Zero's - Unchecked this property.
Now you run the fast report. It will work fine.
Please try the same and update your comments.
1. Right click on the field (Date Field)
2. Hide Zero's - Unchecked this property.
Now you run the fast report. It will work fine.
Please try the same and update your comments.