SSRS StripLine中间日期X轴

时间:2016-03-16 12:19:25

标签: reporting-services charts ssrs-2008-r2

我正在尝试在SSRS2008中显示垂直条纹。

enter image description here

在这种情况下我想显示5月4日的线(图表中心) 我不知道如何在表达式中定义x轴的中心日期。

1 个答案:

答案 0 :(得分:2)

您可以使用DateAddDateDiff组合计算中心日期。

=DateAdd(DateInterval.Day,
 DateDiff(DateInterval.Day, Min(Fields!DTE.Value), Max(Fields!DTE.Value))/2,
 First(Fields!DTE.Value)).ToOADate -0.5

似乎有必要.ToOADate使StripLine放置在SSRS 2008 R2中工作。 -0.5是让StripLine在两个日期之间开始,而不是恰好在中心日期。

在StripLine属性中,将上述表达式添加到IntervalOffset并将StripWidth设置为1.将“间隔”类别中的其他属性保留为“自动”。

chart with stripline