在SSRS报告2014中显示所有工作日,可以通过以下步骤实现:
Public Function GetWorkingDays(ByVal startDate As DateTime, ByVal endDate As DateTime) As Integer
Dim count As Integer = 0
Dim currentDate As DateTime = startDate
While currentDate <= endDate
If currentDate.DayOfWeek <> DayOfWeek.Saturday AndAlso currentDate.DayOfWeek <> DayOfWeek.Sunday Then
count += 1
End If
currentDate = currentDate.AddDays(1)
End While
Return count
End Function
=Code.GetWorkingDays(Parameters!StartDate.Value, Parameters!EndDate.Value)
其中,Parameters!StartDate.Value
和Parameters!EndDate.Value
是报表中的起始日期和结束日期参数。
这样,报表将根据起始日期和结束日期参数计算工作日的数量,并在报表中显示。
领取专属 10元无门槛券
手把手带您无忧上云