基于 SSRS Tablix 列组的格式化,单元格不包含任何值

发布于 2024-09-30 22:37:56 字数 212 浏览 1 评论 0原文

我有一份带有 tablix 的报告。在 Tablix 中,我有 2 个列组,列组中的第一级是“大陆”,第二级是“国家”。现在,用户希望根据“大陆”组中的值具有不同的背景颜色,以便所有亚洲国家均为绿色,所有欧洲国家均为蓝色。只要单元格具有值,这种方法就可以正常工作。然而,有时数据库中没有相关记录,因此 Tablix 上的单元格保持为空。 有没有办法在格式化表达式中使用此信息来找出这样的空单元格属于哪个列组?

I have a report with a tablix. In the Tablix I have 2 Column Groups, the first level in the Column Groups is "Continent" and the second level is "Country". Now the users want to have different background colors depending on the value in the "Continent" group so that all Asian Countries are green and all European Countries are blue. This works fine as long as a cell has a value. However sometimes there is no record for that in the database therefore a cell on the tablix stays empty.
Is there a way to find out to which Column Group such an empty cell belongs to use this information in the formating expression ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花开浅夏 2024-10-07 22:37:56

Moontear 有所发现,更改查询以始终为每个组合返回结果可能会更容易。

您可以直接在 RS 中获得您想要的东西。如果您向 tablix 添加另一个单元格以强制 RS 计算两列交集的结果,则可以使用 Fields!Continent.Value。即,如果您添加一个 =count(Fields!Continent.value) 的单元格,那么它将返回 0,然后您可以使用类似 =iif(Fields!Continent.Value= 的表达式1,"Red","White")

然后,您需要将列缩小到 0 宽度并隐藏它,这样它就不会在最终输出中看到。

moontear is on to something, it may be easier to change the query to always return a result for every combination.

You can get what you're after directly in RS tho. If you add another cell to your tablix to force RS to calculate a result for the intersection of the two columns then you can use Fields!Continent.Value. i.e. if you add a cell that is =count(Fields!Continent.value) then it'll return 0 and you can then have an expression like =iif(Fields!Continent.Value=1,"Red","White")

You'll then want to shrink the column down to 0 width and hide it so it doesn't get seen in the final output.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文