Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Check if date is available -> then show other field

edited August 2006 in RAP
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.

Comments

  • edited August 2006
    Hello Stef,

    Found it myself.

    procedure TijdenOnPrint;
    begin
    If Trunc(FacturenUITDetails['Datum']) = 0 then
    Tijden.Visible := False
    else
    Tijden.Visible := True;
    end;
This discussion has been closed.