Report Viewer Expression

三世轮回 提交于 2020-01-25 00:12:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!