Use of IFF

I am using Fastreport in Delphi XE6/XE7 for a short time. Therefore I am not yet very expierienced with Fastreport.
Unfortunately not all the possibilities of Fastreport, like scripting, can be used in Fastreport in Delphi.
I am now trying to use all the possibilities that I have. I am having an problem with the use of IFF.

I have a databasefield 'Prod_Actief' of the dataset 'Prod' which is a boolean field.
In stead of displaying True of False in the report, I like to display 'Ja' and 'Nee', dutch for 'Yes' and ' No'.
I have put the following statement in the memo-field: => [IIF( vartostr(<Prod."Prod_Actief">) == "TRUE",'Ja','Nee')] <=

When I run the preview I get an error. An ')' is expected. (See included picture in file)

=> The following error(s) have occured:
Memo7: Error in Expression 'IIF( vartostr(<Prod."Prod_Actief">) ==
"TRUE",'Ja','Nee'): ')' expected <=

By the way: Does anyone a place where I can find a manual which describes short and clear all the functions Fastreport.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:57AM
    you need 1 more set of () the btest expression must eval to true or false.

    [IIF( (vartostr(<Prod."Prod_Actief">) == "TRUE"),'Ja','Nee')]
    when having problems with syntax try using fr's buily in exptession builder to help.

    in designer window select the functions tab all the functions and their requirements are listed.
  • edited 1:57AM
    For what it's worth, because Prod.Prod_Actief is a boolean field, you should be able to write it like:

    [IIF( <Prod."Prod_Actief">,'Ja','Nee')]
  • edited March 2015
    So I have read and tried the two suggested answers, in the designer.
    I have tried both:
    [IIF( (2>5) == "TRUE"),'Ja','Nee')]
    [iff ((1> 2) and (6<5)), 'TEXT1', 'Text4']
    in Memo as well as system variable text.
    I keep on getting the same error in expression
    )' identifier expected

    I have added extra parens as well as taken them away
    Using XE3 and FR 4
    What am I not seeing?
  • edited 1:57AM

    I believe that "==" is correct if you are using C++ script. If you are using PascalScript use "=" instead.

    Have you tried it without the "and"? Im not sure if IIF supports "and" (logical or bitwise).

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.