如何在报表中格行换色

Posted petewell

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何在报表中格行换色相关的知识,希望对你有一定的参考价值。

摘要:如何在报表中格行换色


如何在报表中格行换色
1.Table(数据表)?使用
????? iif(rownumber() mod 2 ,color1,color2)
??
2.Matrix(矩阵表)
?? 矩阵表不能使用Rownumber 或columnnumber()等方式处理.用此方式都会产生不预期的结果.数据颜色会乱跳.因此要做一些变通手法
???例如我们想要做复数列变成绿色
?? 一般我们会用iif(RowNumber(Nothing) Mod 2,"Green","White").这样子的方式处理.

?? Step 1. 需在列群组之中新增一个列的群组值.这个群组值是1

?? Step? 2.插入列中的表头并且设定运算值为
?????????????? =iif(RunningValue(Fields!Country.Value,CountDistinct,Nothing) Mod 2, "AliceBlue", "White")
?????????? 如果有多个群组则必须设定如下:
?????????????? =iif(RunningValue(Fields!Country.Value & CStr(Fields!Year.Value),CountDistinct,Nothing) Mod 2, "AliceBlue", "White")

?? Step 3. 在插入列中的表头列中设定背景颜色值为
????????????? =Value
???
?? Step 4.在矩阵表中的数据中的背景颜色设定对应来源群组列的字段名称.值
??????????? 例如:
????????????? =ReportItems!ColorNameTextbox.Value
???
???Step 5.将所有列表头部分设定相同颜色内容.
???
???Step 6.将产生出来的多的列字段设为最小值.
???????????
For a green-bar table, you can simply use a background color expression like this: =iif(RowNumber(Nothing) Mod 2,"Green","White")
However, there is currently no GroupNumber() function on which to base a green-bar calculation in a matrix.
GroupNumber can be (mostly) simulated by using the RunningValue function to get a running distinct count of group expression values.
However, the trickiest part of green-bar in a matrix is the fact that some matrix cells may contain no data at all.? This makes the group number calculation incorrect for empty cells.
To work around this, you need to effectively calculate the group number in the row header and then use that value inside the data cells.

Step 1:? Add a (fake) inner row grouping
Select the innermost row grouping in your matrix.? Right-click and select Insert Group.
For the group expression, group on a constant, such as =1

Step 2:? Calculate the name of the color in the inner row grouping header
In the Value property of the newly created grouping header, add a calculation for the desired color based on a running value of a count distinct of the containing group expression.
For example: =iif(RunningValue(Fields!Country.Value,CountDistinct,Nothing) Mod 2, "AliceBlue", "White")
Note:? If you have more than one row grouping, you may need to do the count distinct on the combination of all group expressions, like this:
=iif(RunningValue(Fields!Country.Value & CStr(Fields!Year.Value),CountDistinct,Nothing) Mod 2, "AliceBlue", "White")

Step 3:? Set the background color of the inner row grouping header to =Value

Step 4:? Set the background color of the matrix data cell to the value of the inner row grouping header
For example:? =ReportItems!ColorNameTextbox.Value

Step 5:? Set the background color of the outer row grouping header
You‘ll need to use the same expression here that you used for the Value of the inner row grouping header.

Step 6:? "Cloak" the inner row grouping header (so it looks like part of of the outer grouping header)
Set the right border style of the outer grouping header to None.
Set the left border style of the inner grouping header to None.
Set the font weight of the inner grouping header to 1 pt.
Set the font color of the inner grouping header to =Value.
Set the CanGrow property of the inner grouping header to False.
Drag the inner grouping header to be as narrow as possible.
Optional:? Hand-edit the RDL to set the width of the inner grouping header to 0in.

A full working sample of green-bar matrix is attached.





请大家永跃参与Facebook MSBI 粉思团:http://www.facebook.com/#!/group.php?gid=303757165010

原文:大专栏  如何在报表中格行换色




















































以上是关于如何在报表中格行换色的主要内容,如果未能解决你的问题,请参考以下文章

如何在 EditText Android 中禁用退格行​​为?

如何在 OpenOffice Calc 宏中获得合并的单元格行/列跨度

如果超过 indexpath.row,如何在表格视图中设置单元格行高?

elementuitable左右固定如何调整每个单元格行高

在excel中用VBA如何实现对非空单元格行数的统计。

element ui table左右固定如何调整每个单元格行高