I have ASP.NET MVC Application having SSRS Reports..
I have written following code in an Expression :
=iif(Fields!Aggr3.Value is nothing,"", iif(cStr(Fields!Aggr3.Value).IndexOf(".") >=0 , Format(Fields!Aggr3.Value,"C"),Fields!Aggr3.Value))
Field Aggr3 contains Dynamic Values it can be either "Null" or Decimal Value or Integer Value.. If value is Decimal I want to Format it with $ Currency. otherwise if value is interger value then i want to saw it as normal value.
so i written above expression.. but when generating Report column value displays #Error
i changed iif Condition to Switch condition as follows :
=Switch(IsNothing(Fields!Aggr2.Value), "",
not IsNothing(Fields!Aggr2.Value),
Switch(cstr(Fields!Aggr2.Value).IndexOf(".") >=0,Format(Fields!Aggr2.Value,"C"),
cstr(Fields!Aggr2.Value).IndexOf(".") <0,Fields!Aggr2.Value))
but it also throws an Error..
what is the error and how to solve it ??
Thanks