Reputation: 7092
trying to format number (decimal), but it shows me #Error
on production server:
=FormatNumber(First(Fields!SumWithMailDelivery.Value, "document"), 0)
but on developers server it works fine. Maybe someone know, how can i resolve this?
p.s. without formatting it works on production server fine too.
Upvotes: 2
Views: 1452
Reputation: 20560
As @IanPreston says, it is most likely a type conversion error. I imagine your production data has some invalid characters for that column or some Null
columns that make the numeric conversion fail.
You can use the Val
function to do the conversion. Val
differs from other numeric conversion functions in that it won't error when the string to be converted isn't numeric - it just does the best job it can.
So try an expression like this for the Value
property:
=IIF(Fields!SumWithMailDelivery.Value Is Nothing,
Nothing,
IIF(IsNumeric(Fields!SumWithMailDelivery.Value),
Val(Fields!SumWithMailDelivery.Value),
Fields!SumWithMailDelivery.Value)
)
then use N0
as the Format
property to format it as numeric if possible.
This formula will:
Nothing
if the field is Null
Upvotes: 3