ahmed
ahmed

Reputation: 11

Report Viewer Expression

Basically, I want to check if the value of field F1 is not empty. If the row not empty then I want to calculate F2 * F3

The following expression always print

 #Error 
=IIf(Fields!f1 ="" ,"" ,Fields!f2.Value* Fields!If3.Value)

Please help

Upvotes: 1

Views: 2470

Answers (3)

Alberto
Alberto

Reputation: 21

You must use the Val function.

=IIF(IsNumeric(Fields!f2.Value) and IsNumeric(Fields!If3.Value),
     Val(Fields!f2.Value)*Val(Fields!If3.Value),
     Nothing
)

ReportViewer is a pain. IIf always evaluate 2 parts (true and false).

Upvotes: 2

user599977
user599977

Reputation: 331

Go and check the field expression. if you have something like: sum(fieldName) you must replace it with fieldName

Upvotes: 0

Related Questions