SSRS 2008 Column Visibility Expression Evaluates to true, column not visible

两盒软妹~` 提交于 2019-12-10 21:31:44

问题


This is not working and it is driving me nuts.

I have in the column visibility the following expression:

=IIF(CInt(Fields!SomeField.Value) > 0,True,False)

The value of "SomeField" is 1. I am able to verify this by looking both at the dataset, and another column I added to the report just to see what the IIF is evaluating to. It evaluates to True.

Shouldn't this make the column show?


回答1:


I have just tried the following =IIF(Fields!MyID.Value > 0, True, False) in Report Builder and it works fine. Try returning "SomeFieldValue" as an integer either at the database or dataset level.

For instance in your dataset query, cast SomeFieldValue to an int and then in the column visibility expression try:

=IIF(Fields!SomeFieldValue.Value > 0, True, False) 



回答2:


If you have fields that contain values and not numbers then the following should work to hide columns that have only NULL values for each row in the column.

Place this code as an expression in the Column Visbility object for each column that you want to evaluate

=IIF(Count(Fields!.Value) = Cint(0), True, False)



来源:https://stackoverflow.com/questions/9899518/ssrs-2008-column-visibility-expression-evaluates-to-true-column-not-visible

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