Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 28687

SSRS 2008 R2 - Expression will not hide row, but will hide cell if I apply it to a cell

$
0
0

Hello,

I was wondering if anyone knew if there are any "rules" to row visibility expressions.

I have a simple tablix with 1 header row, 1 detail row.  I wanted to hide specific rows depending on certain circumstances, so I added some visibility expressions under the show/hide option for the ROW.

Before I continue, I will explain it a little more.  The tablix has 7 columns, I created a parent group (which makes an 8th column).  However, I didn't want every row to be returned when I run the report, so I right clicked on the tablix row tab and then Row Visibility.  I selected show/hide based on expression and created my expression.  The expression is as follows, but I changed the values to make it generic:

=(Fields!abc.Value = 1)
 OR 
(Parameters!qwe.Value = 0 AND Fields!type.Value = "A")
 OR 
(Parameters!rty.Value = 0 AND Fields!type.Value = "C")
 OR 
(Parameters!jkl.Value = 0 AND Fields!site.Value = "Site1")
 OR 
(Parameters!bnm.Value = 0 AND Fields!site.Value = "Site2")
 OR 
(Parameters!zxc.Value = 0 AND Fields!site.Value = "Site3")
 OR 
(Fields!rcode.Value = "C")
 OR 
(Fields!rcode.Value = "D")

All of the statements work to hide the row, EXCEPT the last two.  For some reason, the Row Visibility does not catch these 2 statements: (Fields!rcode.Value = "C") or the "D" one.  No error gets thrown either.  It just never results in "True".

I tried changing the syntax, adding another argument to check, using only (Fields!rcode.Value = "C") and removing the rest, also used (Trim(Fields!rcode.Value) = "C"), and none of them worked.  I added another column that displayed the value of rcode and there were rows that had C or D in that row, but it did not hide the row.  I tested the arguments above by taking just (Fields!rcode.Value = "C") and put it on the visibility expression for a single cell.  That worked and hid the individual cell.  I do NOT want to put that in each cell, but that is a pain to maintain.  Plus, it doesn't hide the row, so you get ugly empty space that I am pretty sure would not be able to be condensed in this situation.

Anyway, WHY does the Row Visibility NOT like that expression?  Is there something I am missing?

Again, the other arguments all worked and hid the appropriate rows as designed.

I am running SQL Server 2008 R2 on Windows Server 2008 R2 x64 and Report Builder 3.0 on my Win7 Pro x64 system.

Thanks.

- Gavin



Viewing all articles
Browse latest Browse all 28687

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>