Strugglinh with "IF"
Hi,
I'm trying to use the IF-Function. Unfortunately I can't find an example how the syntax is exactly.
The Documentation says:
IF(<Expression>, String1, String2)
Okay - I just want to have the second row in am memo read "-" in case a value is true and otherwise display another field's value...
So while
["km" #N#,##0.0] km
[IF(["Storniert"]='True', '-', ' km')]
works fine, FR crashes with an empty(!) Error Message (just an OK-Button in it) while creating a report using
["km" #N#,##0.0] km
[IF(["Storniert"]='True', '-', '["Endstand" #N#,##0.0]')]
I also tried to use FormatFloat - but every time I try to print a field-value within the "else"-condition I get this empty error message...
Any ideas?
Cheers,
Mark
I'm trying to use the IF-Function. Unfortunately I can't find an example how the syntax is exactly.
The Documentation says:
IF(<Expression>, String1, String2)
Okay - I just want to have the second row in am memo read "-" in case a value is true and otherwise display another field's value...
So while
["km" #N#,##0.0] km
[IF(["Storniert"]='True', '-', ' km')]
works fine, FR crashes with an empty(!) Error Message (just an OK-Button in it) while creating a report using
["km" #N#,##0.0] km
[IF(["Storniert"]='True', '-', '["Endstand" #N#,##0.0]')]
I also tried to use FormatFloat - but every time I try to print a field-value within the "else"-condition I get this empty error message...
Any ideas?
Cheers,
Mark
Comments
["km" #N#,##0.0] km
[IF(["Storniert"]='True', '-', '["Endstand" #N#,##0.0]')]
doesn't work as I try to format the value. If I write
["km" #N#,##0.0] km
[IF(["Storniert"]='True', '-', '["Endstand"]')]
instead it works - but in this case I don't get the value formatted. So I'll have to use a workaround.
Well - you guys at FR: I hope you do read the forum at least, even if no answers are given here. So it might be that these bugs will be corrected in one of the future versions.
Kind regards,
Mark Meyer
If you use the expression builder it will build the syntax for you.
if using a fmt function the mask must be enclosed with ' ' you are trying to pass a string value, the internal parser strips ' just like delphi.
An expression can have up to 3 parameters,but a parameter can have an expression with up to 3 params so you can create very complex expressions very easily. one of the easiest ways to add or change format masks is to create
dictionary variables containing the masks you want as string expressions then all you need to do is insert the variable where required.
regards