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. 總是有這種「安裝錯誤:INSTALL_FAILED_OLDER_SDK」
- 2. 月份值總是打印錯誤
- 3. 語法錯誤:打印「...」總是有錯誤
- 4. 如何打印這種格式的表
- 5. 爲什麼在這種情況下打印錯誤?
- 6. 鏈表段錯誤/打印
- 7. JaspeReports錶行打印錯誤
- 8. 爲什麼這個flowdocument表總是打印2列
- 9. 打印錯誤
- 10. iReport - 「當打印時表達式」中的PageFooter帶錯誤
- 11. 錯誤在打印
- 12. Django打印錯誤
- 13. 錯誤打印posix_time
- 14. 如何用這種技術打印?
- 15. 正則表達式中這種替代方法的描述是否錯誤?
- 16. 驗證錯誤打印{{錯誤}},而不是真正的錯誤
- 17. 爲什麼這總是評估錯誤?
- 18. regex.h:打印子表達式
- 19. 打印表達式樹
- 20. 水晶報表打印到錯誤的打印機
- 21. 這種語法是錯誤的嗎?
- 22. 這是某種指針錯誤?
- 23. Pycharm識別打印kwargs是錯誤(python3)
- 24. 在sqllite沒有這種表錯誤-Android
- 25. 循環錯誤的打印表
- 26. A2LiX翻譯表格 - 無錯誤打印
- 27. 段錯誤當試圖打印鏈表
- 28. 如果報表打印錯誤
- 29. 錯誤打印出表格的行
- 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