我有一个报告,我有一个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 FunctionSet the BackgroundColor of your row cells with
=Code.AlternateColor("AliceBlue", "White", True)Add alternating row color to SQL Server Reporting services report
更多推荐
发布评论