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

No date value printing Today's Date

edited May 2002 in General
Hello,

In my group footer I have a variable (date type) that is set to a certain
date field if a condition is met. If the data has no date value then it
prints today's date. How to get the report to print nothing if there is no
date. What value does no date have?

Thanks,
Ian

Comments

  • edited May 2002
    You can implement the OnGetText event of the variable component and return
    an empty string if there is no data in the date field.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    I set the value of a variable as follows:
    glbLifeDate.Value := Insurance['EnrollmentDate'];

    in a subreport. glbLifeDate is a TppVariable which I set to equal
    varLifeDate on the report's create. If there is no "Enrollment Date" then
    the date defaults to today so when I do a check on the OnGetText what value
    do I compare it to to see if I want the variable to be blank? It seems the
    default value for a date variable is today's date and checking against 0 has
    not worked either

    if varLifeEnrollmentDate.Value = ? then Text := '';

    thanks,

    Ian






    "Alexander Kramnik (Digital Metaphors)" wrote
  • edited May 2002
    You would have to check the value in the pipeline rather than in the
    variable, i.e.

    procedure TForm1.ppVariable1GetText(Sender: TObject; var Text: String);
    begin
    if (Insurance['EnrollmentDate'] = 0 then
    Text := '';
    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.