0
A
回答
0
到IIF中的參數都進行評估,不論測試的值。讓我們分解表達式來看看會發生什麼。
P1 = ISNOTHING(Fields!f2.Value) // this gets evaluated and "True" is the value
P2 = Fields!f2.Value * Fields!If3.Value // this gets evaluated and throws an #Error
Result = IIF(P1," ",P2) // this never gets evaluated because an error is already thrown
試試這個:
=IIF(ISNOTHING(Fields!f2.Value)," ", IIF(ISNOTHING(Fields!f2.Value),0, Fields!f2.Value) * Fields!If3.Value)
在這種情況下,當F2爲null這裏發生了什麼:
P1 = ISNOTHING(Fields!f2.Value) // this gets evaluated and "True" is the value
P2 = IIF(P1,0, Fields!f2.Value) // this gets evaluated and 0 is the value
P3 = P2 * Fields!If3.Value // this gets evaluated and 0 is the value
Result = IIF(P1, " ", P3) // this gets evaluated and " " is the result
+0
'SWITCH'也表現出同樣的行爲嗎? 「SWITCH」中的每個子句都評估過嗎? – SouravA 2015-01-22 12:10:15
+1
它適用於IIF(),因爲它是一個函數調用。就像任何其他函數調用一樣,參數被評估並傳遞給函數。 SSRS中的SWITCH()也是一個函數調用,所以是的。每次都會評估所有參數。 – 2015-01-22 13:37:24
相關問題
- 1. 如何打印這種格式的表
- 2. 爲什麼在這種情況下打印錯誤?
- 3. 鏈表段錯誤/打印
- 4. JaspeReports錶行打印錯誤
- 5. 爲什麼這個flowdocument表總是打印2列
- 6. 打印錯誤
- 7. iReport - 「當打印時表達式」中的PageFooter帶錯誤
- 8. 錯誤在打印
- 9. Django打印錯誤
- 10. 正則表達式中這種替代方法的描述是否錯誤?
- 11. 驗證錯誤打印{{錯誤}},而不是真正的錯誤
- 12. regex.h:打印子表達式
- 13. 這種語法是錯誤的嗎?
- 14. 這是某種指針錯誤?
- 15. Pycharm識別打印kwargs是錯誤(python3)
- 16. 循環錯誤的打印表
- 17. 複選框列表打印錯誤
- 18. 方法錯誤地打印表
- 19. PHP註冊表格打印錯誤
- 20. Django的表單錯誤打印__all__
- 21. 如果報表打印錯誤
- 22. 打印時爲多態表達式選擇了哪種類型?
- 23. 爲什麼這段代碼總是打印「不匹配」?
- 24. 如何打印總是打印一列的字符
- 25. C#AcroPDF總是在第一臺打印機上打印
- 26. 此Java程序總是隻打印10個,但不打印SB.Why?
- 27. supervisorctl總是報告錯誤:錯誤(沒有這樣的文件)
- 28. 數組打印段錯誤
- 29. 打印csv'無'錯誤
- 30. 打印陣列錯誤
我猜你想乘非數字數據。 f2和f3的數據類型是什麼? – AlexCuse 2010-06-21 18:24:09
這個問題是爲[報告查看器表達式]的答案(http://stackoverflow.com/questions/3087082/report-viewer-expression) – gbn 2010-06-21 19:09:00