Check if date is available -> then show other field
Hi,
I'm using 10.04 with RAP.
This is what I need to do:
On my detail-report I have o.a. two fields: Date and Time
When printing the report it is showing 4 records of which 3 contain a date
(other is empty.
I want to check per record if there is a (valid) date and based on that I
want to show/hide the Time-field.
01-01-2006..15:30
01-01-2006..15:30
..................15:30
01-01-2006..15:30
Should become:
01-01-2006..15:30
01-01-2006..15:30
.........................
01-01-2006..15:30
I put some code in the OnPrint event of the Time-field, but as you can guess
"It doesn't work"
If FacturenUITDetails.ObjectFields['Datum'].IsNull then
Time.Visible := False;
I also tried to use this in the OnPrint event of the Date-field, but all
messages said "field value is null"??
ShowMessage(FormatDateTime('DD-MM-YYYY',FacturenUITDetails['Datum']));
Regards,
Stef
PS: Is there some extended RAP guide available? The "Learning to RAP" is
pretty thin.
I'm using 10.04 with RAP.
This is what I need to do:
On my detail-report I have o.a. two fields: Date and Time
When printing the report it is showing 4 records of which 3 contain a date
(other is empty.
I want to check per record if there is a (valid) date and based on that I
want to show/hide the Time-field.
01-01-2006..15:30
01-01-2006..15:30
..................15:30
01-01-2006..15:30
Should become:
01-01-2006..15:30
01-01-2006..15:30
.........................
01-01-2006..15:30
I put some code in the OnPrint event of the Time-field, but as you can guess
"It doesn't work"
If FacturenUITDetails.ObjectFields['Datum'].IsNull then
Time.Visible := False;
I also tried to use this in the OnPrint event of the Date-field, but all
messages said "field value is null"??
ShowMessage(FormatDateTime('DD-MM-YYYY',FacturenUITDetails['Datum']));
Regards,
Stef
PS: Is there some extended RAP guide available? The "Learning to RAP" is
pretty thin.
This discussion has been closed.
Comments
Found it myself.
procedure TijdenOnPrint;
begin
If Trunc(FacturenUITDetails['Datum']) = 0 then
Tijden.Visible := False
else
Tijden.Visible := True;
end;