简体   繁体   English

在SSRS报告的Tablix中使用表达式边框样式

[英]Using an Expression for Border Style in a Tablix in SSRS report

I have an interesting dilemma with an SSRS report that the powers that be have decided needs some extra styling. 我有一个有趣的困境,一份SSRS报告说,已经决定的权力需要一些额外的造型。

I basically have a column group that I need to have a bold border around. 我基本上有一个列组,我需要有一个粗体边框。 In the picture below, I need to have the lines I've drawn in red be larger (so setting their width to 3pt font): 在下面的图片中,我需要将我用红色绘制的线条更大(因此将它们的宽度设置为3pt字体):

示例截图

The second pictures shows the construct of the tablix that makes up the graph. 第二张图片显示构成图表的Tablix的构造。 The column groups are broken down into ClassroomMeasure (the lowest level) and ClassroomMeasureType (the header above the ClassroomMeasure and the group on which I need to have a thicker border). 列组分为ClassroomMeasure(最低级别)和ClassroomMeasureType(ClassroomMeasure上方的标题和我需要更粗边框的组)。 I tried setting the border expression to: 我尝试将边框表达式设置为:

IIF(Fields!ClassroomMeasureType.Value = Previous(Fields!ClassroomMeasureType.Value), "1pt", "3pt")

But this gave an error: 但这给出了一个错误:

"The use of a Previous aggregrate function in a TablixCell is not supported." “不支持在TablixCell中使用Previous聚合函数。”

Now I suppose I could work around this by checking for each ClassroomMeasure (the lower group) that is ordered at the end of each group and setting its border but there are about 200 of these across every version of this report and that would be a huge headache. 现在我想我可以通过检查在每个组的末尾订购并设置其边界的每个ClassroomMeasure(较低的组)来解决这个问题,但是在这个报告的每个版本中大约有200个这样的,这将是一个巨大的头痛。

Any ideas on how I could achieve this programatically? 关于如何以编程方式实现这一点的任何想法?

This could be done by adding a column inside the ClassroomMeasureType group adjacent to the ClassroomMeasure group, splitting the header cell and then making that column 2pts wide and black. 这可以通过在ClassroomMeasure组旁边的ClassroomMeasureType组中添加一个列来完成,拆分标题单元格,然后使该列宽2和2。

To do this, you would right click on the <<expr>> cell for the ClassroomMeasure group and select 'insert column - inside group', then right click on the ClassroomMeasureType header and split cell. 为此,您可以右键单击ClassroomMeasure组的<<expr>>单元格,然后选择“插入列 - 内部组”,然后右键单击ClassroomMeasureType标题并拆分单元格。 Then there would be a new column that would appear in the places you want a thick border, so make it very narrow (ie 1pt) with a thick right border. 然后会有一个新的列出现在你想要一个粗边框的地方,所以要使它非常窄(即1pt),右边框很粗。

This would, however, come out as an empty or hidden column if you export to excel, which might be undesirable. 但是,如果导出到excel,这将显示为空列或隐藏列,这可能是不合需要的。

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

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