问题
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
回答1:
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).
回答2:
Go and check the field expression. if you have something like: sum(fieldName) you must replace it with fieldName
回答3:
Maybe this will help You http://awebthatworks.wordpress.com/2010/04/29/reportviewer-expressions-which-use-data-fields-show-as-error/
来源:https://stackoverflow.com/questions/3087082/report-viewer-expression