How to filter rows with null values in any of its columns in SSRS

流过昼夜 提交于 2019-11-29 11:15:06

问题


I want to filter out the output without rows containing null values or blank columns. I am using Sql server 2012 there is no option named 'Blank' as in SS2005 where I can filter the rows. I also tried following expression but it gives me error or not showing correct output

=IsNothing(Fields!ABC.Value)!= True 
=Fields!ABC.Value = ''

Please suggest the solution.


回答1:


We should use the isNothing method in the Expression, change the Text to Boolean and then Value will be "True"

for example:

Expression 
=IsNothing(Fields!TestA.Value)<>True
(Expression type should be Boolean)
Operator
=
Value
=True



回答2:


  • Pull up the tablix or group properties
  • Switch to "Filters"
  • Add a new filter
  • Set the expression to:

    =IsNothing(Fields!YourFieldHere.Value)

  • Set the type to "Boolean" (see screenshot below) otherwise you'll get a "cannot compare data of types boolean and string" error.

  • Set the value to false

This works for filtering both rows and groups.




回答3:


Edit the SQL query, so that it will not return NULL values in the column to group on, but let it return a dummy value; for example: ISNULL(columnA, 'dummy')

In the column group definition add a filter: ColumnA <> 'dummy'.



来源:https://stackoverflow.com/questions/12814117/how-to-filter-rows-with-null-values-in-any-of-its-columns-in-ssrs

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