IIf and expressions
I like to print a conditional to a parameter. I entered an expression as follows:
[IIf([newpage_groepveld]=="1" , [Table.afroepregels_refentie] , [Table.afroepregels_plantnaam])]
Because IIf is a VB syntax I tried the C# syntax also:
[newpage_groepveld]=="1" ? [Table.afroepregels_refentie] : [Table.afroepregels_plantnaam];
Both do not work.
How can I conditional print the one or the other field?
Tia
Hans
[IIf([newpage_groepveld]=="1" , [Table.afroepregels_refentie] , [Table.afroepregels_plantnaam])]
Because IIf is a VB syntax I tried the C# syntax also:
[newpage_groepveld]=="1" ? [Table.afroepregels_refentie] : [Table.afroepregels_plantnaam];
Both do not work.
How can I conditional print the one or the other field?
Tia
Hans
Comments
Both
[IIf([newpage_groepveld]=="1" , [Table.afroepregels_refentie] , [Table.afroepregels_plantnaam])]
and
newpage_groepveld]=="1" ? [Table.afroepregels_refentie] : [Table.afroepregels_plantnaam
must work. The "newpage_groepveld" report parameter must be of String type. If it is numeric, use ... == 1 instead of ... == "1".
Is this caused because we using an expression with a "IIf"in a group header?
BTW, we can use expression like [Table.col1] + [Table.col2], it only fails when we add the "IIf" construction.
IIf([newpage_groepveld]=="1" , [Table.afroepregels_refentie] , [Table.afroepregels_plantnaam])
(they are needed if you print this in the Text object).