简体   繁体   English

将列可见性设置为表达式后不显示 SSRS 报告

[英]SSRS report not showing after set column visibility to expression

I stuck on setting Column visibility.我坚持设置列可见性。 I even built a simple report - list department name from Dept table, (select deptid, deptName, Location from Depttable) .我什至构建了一个简单的报告 - 从Dept表中列出部门名称, (select deptid, deptName, Location from Depttable)Dept表中(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.添加参数,将第一列的可用值添加为“01”,它在报告生成器中工作正常。 then I deployed it, it return 0 error.然后我部署了它,它返回 0 错误。 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!提前谢谢了!

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: 我有2条建议:

1--remember that your expression is set for hidden. 1-请记住,您的表情已设置为隐藏。 When it evaluates to true , then it will hide the column, when it evaluates to false , it will show the column. 当它的值为true时 ,它将隐藏该列;当它的值为false时 ,将显示该列。 Be sure your logic is correct in your expression. 确保您的逻辑表达正确。

2--Test your report on the server by setting the column to show. 2--通过设置要显示的列在服务器上测试报告。 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) (增加复杂性时,在显示表达式值的一侧添加一列或文本框会很有帮助-这样一来,您就可以了解SSRS如何评估表达式)

I often get different behavior in Report Builder than on the server due to the fact that Report Builder caches things like crazy. 由于Report Builder会缓存疯狂的内容,因此我经常在Report Builder中获得与在服务器上不同的行为。 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 http://beyondrelational.com/modules/2/blogs/115/Posts/14532/clear-report-builder-cache.aspx

If you are trying to hide the data by comparing a string don't use "==", instead use Equals() .如果您试图通过比较字符串来隐藏数据,请不要使用“==”,而是使用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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM