How to use IIF function in FastReports?

Wennie picture Wennie · Dec 31, 2015 · Viewed 12.1k times · Source

I have a field that contains an integer value (1 or 0 only), if the field contains 0 I want to print 'Male' in my report; if it's 1, then print 'Female'.

This is what I have done so far and it doesn't work:

[IIF(<ReportPersonal."civilStatus"> = 0, 'Male', 'Female')]

That code always prints 'Male' though the value of the civilStatus field is '1'.

Here is the Link to the report file

Advanced thanks to our experts.

Answer

Val Marinov picture Val Marinov · Jan 3, 2016

In MemoView "ReportPersonalcivilStatus" has :

DisplayFormat.FormatStr="False,True" DisplayFormat.Kind="fkBoolean". 

Try to set Memo - > Format to Text(no formating).