SSRS How do I rotate between reports in a slideshow manner?

六月ゝ 毕业季﹏ 提交于 2019-12-10 17:18:31

问题


I have been tasked with creating a dashboard to be displayed on TV monitors. This dashboard has 5 different charts that need to be displayed in a slideshow manner - in other words, one chart at a time, rotating to the next over a timed interval.

I used a solution posted on here with the visibility property =IIf(Second(Now()) >= 48 AND Second(Now()) <= 60, False, True) and so on with the report auto-refreshing at 12 second intervals.

However, my manager came back to me with the feedback that 12 seconds was too short of an interval, and that he would like to see each report for 20 seconds before it is rotated to the next one.

Does anyone have any ideas on how to make this possible?

Thanks so much.


回答1:


You want to move from a 60 second cycle to a 100 second cycle.

Based on your existing code, you could use something like:

=IIf(DateDiff(DateInterval.Second, Today(), Now()) Mod 100 >= 80
    AND DateDiff(DateInterval.Second, Today(), Now()) Mod 100 <= 99
  , False
  , True)

You get the 100 second cycle by taking the number of seconds since the beginning of the day Modulo 100. You can then break this down into buckets of twenty in your expression instead of buckets of 12.




回答2:


I have expanded on Ian Preston's solution with custom code. I basically wanted to make the solution fully expandable.

Use this in the Row Visibility Expression: =Code.SubReportHidden(RowNumber("Tablix1"), CountRows("Tablix1"), Parameters!ReportRefresh.Value, Now())

This is a custom parameter to change the refresh on the fly. You will also need to reference it in the Reports AutoRefresh property.

Parameters!ReportRefresh.Value

Add this to your reports Custom Code:

Public CurrentTimeInSeconds As Long
Private MinCycleRange As Long
Private MaxCycleRange As Long
Private PageCount As Integer
Private Page As Integer
Private FullCycle As Long
Private CurrentTime As DateTime

Public Function SubReportHidden(ByVal page As Integer, ByVal pageCount As Integer, 
  ByVal interval As Long, ByVal now As DateTime) As Boolean

If page.Equals(0) Then Throw New ArgumentOutOfRangeException("page")
If pageCount.Equals(0) Then Throw New ArgumentOutOfRangeException("pageCount")
If interval.Equals(0) Then Throw New ArgumentOutOfRangeException("interval")

Me.PageCount = pageCount
Me.Page = page
FullCycle = interval * pageCount
CurrentTime = now
SetCurrentTimeInSeconds()

SetMaxCycleRange()
SetMinCycleRange()

Dim visable As Boolean = True
If InRange() Then
  visable = False
End If
Return visable
End Function

Private Function InRange() As Boolean
Dim insideRange As Boolean = False
If CycleProgressPercent() > MinCycleRange AndAlso CycleProgressPercent() <= 
  MaxCycleRange Then
  insideRange = True
End If
Return insideRange
End Function

Private Function CycleProgressInSeconds() As Long
  Return CurrentTimeInSeconds Mod FullCycle
End Function

Public Function CycleProgressPercent() As Integer
  Return CInt(CycleProgressInSeconds() / FullCycle * 100)
End Function

Private Sub SetCurrentTimeInSeconds()
  CurrentTimeInSeconds = DateDiff(DateInterval.Second, DateTime.Today, CurrentTime )
End Sub

Private Sub SetMinCycleRange()
  MinCycleRange = CLng(((Page - 1) / PageCount) * 100)
End Sub

Private Sub SetMaxCycleRange()
  MaxCycleRange = CLng(((Page / PageCount) * 100))
End Sub

I have taken the time to rewrite the code as well, check out my GitHub for a testable solution. GitHubSSRS_Item_Cycle_Demo




回答3:


We do this with about 16 screens and I can update all of them at the same time from a single dashboard, with variable intervals etc, using a tool called Vue Pilot.

Check it out at https://www.vuepilot.com



来源:https://stackoverflow.com/questions/25673272/ssrs-how-do-i-rotate-between-reports-in-a-slideshow-manner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!