MindFusion.Reporting for Silverlight Programmer's Guide
IIf

Returns one of two objects, depending on the evaluation of an expression.

Syntax

 Copy Code

object IIf (
    bool condition,
    object a,
    object b
)

Parameters

condition
The expression you want to evaluate.
a
An expression returned if condition evaluates to true.
b
An expression returned if condition evaluates to false.

Return Value

Returns a if condition evaluates to true; otherwise, returns b.

Example

The following example demonstrates how you can use IIf to find the smaller of two numbers:

 Copy Code

IIf(5 < 3, 5, 3)

Although the result of the above calculation is obvious, this may not always be the case. Here is the same example applied to fields from a database:

 Copy Code

IIf(Field1 < Field2, Field1, Field2)

See Also

Program Flow Functions