i know that it has been said that the IIf function evaluates both the true and false expression and reports an error if either causes an error and this is done by design. I'm just confused how, without a user function, to do certain, everyday things. For example.. In case of this simple report:
item.... sold... avg price.. in stock.. avg days
A112 5 112.00 5 22
A113 0 !DIV 1 12
A114 1 114.00 0 !DIV
in a normal situation you would get the avg price by using the expression =iif(Fields.sold>0,Fields.totalprice/Fields.sold,0) and avg days in stock =iif(Fields.instock>0,Fields.totaldaysinstock/Fields.instock,0)
but in telerik reports the expression will cause a divide by 0 error because both expressions in the iif() are evaluated. These are simplified examples and I understand there is an avg() function, but there is more processing going on that voids it's use.
item.... sold... avg price.. in stock.. avg days
A112 5 112.00 5 22
A113 0 !DIV 1 12
A114 1 114.00 0 !DIV
in a normal situation you would get the avg price by using the expression =iif(Fields.sold>0,Fields.totalprice/Fields.sold,0) and avg days in stock =iif(Fields.instock>0,Fields.totaldaysinstock/Fields.instock,0)
but in telerik reports the expression will cause a divide by 0 error because both expressions in the iif() are evaluated. These are simplified examples and I understand there is an avg() function, but there is more processing going on that voids it's use.