Reputation: 1
I stuck on setting Column visibility. I even built a simple report - list department name from Dept
table, (select deptid, deptName, Location from Depttable)
. I then click on the first column, select "column visibility", select show or hide based on an expression.
use
=iif(InStr(Join(Parameters!columnVisibility.Value,","),"01")>0,false,true)
add a parameters, add available value for the first column as "01" it works fine in report builder. then I deployed it, it return 0 error. but when I go to report server to run the report, it did not return anything, even column header. no error message either. can anyone help me please? What I missed? Many thanks in advance!
Upvotes: 0
Views: 2255
Reputation: 11
If you are trying to hide the data by comparing a string don't use "==", instead use Equals()
.
Don't use it like this.
=IIF(Fields!Currency1.Value="USD",True, False)
Try like this.
=IIF(Fields!Currency1.Value.Equals("USD"),True, False)
Upvotes: 1
Reputation: 266
I'm not sure I can offer any specific help to this problem, but I can share some trouble-shooting techniques I use when I'm faced with these kinds of problems. I have 2 suggestions:
1--remember that your expression is set for hidden. When it evaluates to true, then it will hide the column, when it evaluates to false, it will show the column. Be sure your logic is correct in your expression.
2--Test your report on the server by setting the column to show. Be sure that the report has access to the data source and that it is returning data. Once that is confirmed, then put your hidden expression back in, but simplify it to be a simple parameter, then gradually add more complexity to it to see where things are blowing up.
(when adding complexity, it is helpful to add a column or text box off to the side that displays the value of your expression--that way you can see how SSRS is evaluating your expression)
I often get different behavior in Report Builder than on the server due to the fact that Report Builder caches things like crazy. Here's a good article showing how to clear the cache. http://beyondrelational.com/modules/2/blogs/115/Posts/14532/clear-report-builder-cache.aspx
Upvotes: 1