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

Use of wildcards in if statements

edited June 2006 in End User
Hello

I have created a report which gives me a list of vehicles along with there
corresponding fleet numbers. As the list of vehicles is made up of cars
and vans, there fleet numbers are prefixed with either 'C' or 'V'.

On the report i have created a variable which i want to display the total
number of vehicles that has a fleet number that starts with 'C'.

Is there a way for me to accomplish this, I have tried to use wildcards
but it does not return a value.

Regards
Jamie



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited June 2006
    Hi Jamie,

    Inside the OnCalc event of the TppVariable, you will need to check the value
    of the current record and increase the total value if it starts with a C.
    Something like the following...

    lsFieldValue := Report.DataPipeline['Vehicle'];
    if Pos('C', lsFieldValue) = 1 then
    Value := Value + 1;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.