2

I am trying to use an if in my report using a variable as the condition this is what I tried IIF(<Client> = true, "Solde: " + [Solde], "Rendu: " + [Rendu]) but I get the error "undeclared identifier 'Client'"

frxReport1.Variables['Rendu'] := Versement - TotalAmount - Remise;
frxReport1.Variables['Solde'] := SoldClient;
frxReport1.Variables['Client'] := ClientTrue; //ClientTrue is a boolean
1
  • 1
    I see both <> and [] brackets...
    – Jan Doggen
    Sep 21 at 7:53

1 Answer 1

1

I see these problems:

  1. There must be square brackets [] all around the expression
  2. You should use single quotes ' instead of double quotes " for strings
  3. You need to convert your variables values (which I suppose are floating variables) into strings
  4. You have to use the angle brackets <> only, for using variables in the expressions

Furthermore, you can avoid comparing your variable (<Client> = true), just use the variable since it's a boolean variable.

The following expression will work:

[IIF(<Client>, 'Solde: ' + FloatToStr(<Solde>), 'Rendu: ' + FloatToStr(<Rendu>))]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.