SSRS当某些行不可见时,会出现交替行颜色问题(SSRS Alternating row color issues when some rows are not visible)

编程入门 行业动态 更新时间:2024-10-18 14:16:26
SSRS当某些行不可见时,会出现交替行颜色问题(SSRS Alternating row color issues when some rows are not visible)

我有一个报告,我有一个customerID组,没有详细信息组。 我要访问报告的数据集将包含每个客户,以及该客户的众多信息列。 我已经创建了一堆行,这些行被正确标记,并显示与之相关的有效数据(例如, 年龄: 34, 性别:男性)。 我也有一些行,其中返回的数据可能是空白或NULL。 我选择隐藏可见性的这些行。 我不确定如何处理交替的背景颜色,因为总会有一些不可见的行,但你无法预测它们将是哪些。 如果我在数据集中没有数据,我可以消除不可见的行,只显示带有详细分组的行并执行RowNumber Mod解决方案。 我希望有一种简单的方法可以按照我目前设置的方式来实现。 有没有办法检查上一个可见行的背景颜色? 将报表变量设置为下一个可见行的颜色?

I have a report where I have a customerID group, and no detail group. The dataset that I have going to the report will have each customer, as well as numerous columns of information for that customer. I have created a bunch of rows, that are labeled appropriately, and displays valid data associated with it (ex. Age: 34, Sex: Male). I also have some rows where the data coming back may be blank or NULL. These rows I choose to hide the visibility for. I am unsure how to handle the alternating background color, because there's always going to be some rows that are not visible, but you can't predict which ones they will be. If I had the data unpivoted in the dataset, I could just eliminate the rows that would not be visible, and just display the rows with a detail grouping and do the RowNumber Mod solution. I was hoping there's an easy way to do this the way that I currently have it set up though. Is there a way to check the background color of the previous visible row? Set a report variable to the color of what the next visible row should be?

最满意答案

尝试使用交替行颜色代码而不是ROWNUMBER。

Private bOddRow As Boolean '************************************************************************* ' -- Display green-bar type color banding in detail rows ' -- Call from BackGroundColor property of all detail row textboxes ' -- Set Toggle True for first item, False for others. '************************************************************************* Function AlternateColor(ByVal OddColor As String, _ ByVal EvenColor As String, ByVal Toggle As Boolean) As String If Toggle Then bOddRow = Not bOddRow If bOddRow Then Return OddColor Else Return EvenColor End If End Function

设置行单元格的BackgroundColor

=Code.AlternateColor("AliceBlue", "White", True)

将交替行颜色添加到SQL Server Reporting服务报告

Try using the Alternating Row Color code instead of the ROWNUMBER.

Private bOddRow As Boolean '************************************************************************* ' -- Display green-bar type color banding in detail rows ' -- Call from BackGroundColor property of all detail row textboxes ' -- Set Toggle True for first item, False for others. '************************************************************************* Function AlternateColor(ByVal OddColor As String, _ ByVal EvenColor As String, ByVal Toggle As Boolean) As String If Toggle Then bOddRow = Not bOddRow If bOddRow Then Return OddColor Else Return EvenColor End If End Function

Set the BackgroundColor of your row cells with

=Code.AlternateColor("AliceBlue", "White", True)

Add alternating row color to SQL Server Reporting services report

更多推荐

本文发布于:2023-07-22 09:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219088.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:颜色   row   Alternating   SSRS   rows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!