SSRS 2008 R2 - Expression will not hide row, but will hide cell if I apply it to a cell
Wondering if this is a datatyping issue. Try explicitly evaluating that field as a string - something like the following: ... OR (CSTR(Fields!rcode.Value) LIKE "C")...
September 21st, 2012 12:03am

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
Free Windows Admin Tool Kit Click here and download it now
September 21st, 2012 3:40pm

Hi Gavin, From you description, I dont think there are some rules that cause this issue. The expression Fields!rcode.Value = "C works for a single cell as you tested. As per my understand, the last two expressions may be ignore by the previous, this means, if the result of the first expression evaluated determines the final result of the operation, there is no need to evaluate the second expression, because it cannot change the final result. So please check you expression again and see if there are some logical problems in it. If the issue persists, please elaborate the issue, if possible could you please post both the report and the dataset with sample data to us by the following E-mail address? Then, I can try to reproduce the issue again and for further analysis. E-mail:sqltnsp@microsoft.com Regards, Charlie Liao
September 24th, 2012 2:39am

Hi Gavin, From you description, I dont think there are some rules that cause this issue. The expression Fields!rcode.Value = "C works for a single cell as you tested. As per my understand, the last two expressions may be ignore by the previous, this means, if the result of the first expression evaluated determines the final result of the operation, there is no need to evaluate the second expression, because it cannot change the final result. So please check you expression again and see if there are some logical problems in it. If the issue persists, please elaborate the issue, if possible could you please post both the report and the dataset with sample data to us by the following E-mail address? Then, I can try to reproduce the issue again and for further analysis. E-mail:sqltnsp@microsoft.com Regards, Charlie Liao
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2012 2:39am

Hi, Can you test this? Instead of putting the expression on row visibility, put this expression on your group visibility under Show or hide based on an expression (right click on group->Group Properties->Visibilty)Aftab Ansari
September 24th, 2012 2:56am

Hi, Can you test this? Instead of putting the expression on row visibility, put this expression on your group visibility under Show or hide based on an expression (right click on group->Group Properties->Visibilty)Aftab Ansari
Free Windows Admin Tool Kit Click here and download it now
September 24th, 2012 2:56am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics