Search code examples
reporting-servicesgraphssrs-2008report

is there a way to create a graph in an SSRS report where the user can choose between ranges of a variable?


Basically I need to show the trend of executions of a program over time where a user can select if they want to see month/week/daily/hourly data.

So I have a table called ProgramExecutions with the following columns:

ProgramName |  StartDate          | Enddate
------------+---------------------+--------------------
Windows     | 14/10/2015 16:10:00 | 14/10/2015 16:15:00  
Windows     | 13/10/2015 16:10:00 | 13/10/2015 16:15:00      
Windows     | 12/10/2015 16:10:00 | 12/10/2015 16:15:00      
Linux       | 14/10/2015 16:10:00 | 14/10/2015 16:15:00  
Linux       | 13/10/2015 16:10:00 | 13/10/2015 16:15:00      
Linux       | 12/10/2015 16:10:00 | 12/10/2015 16:15:00     

I then have the following query that runs against this table

 Select Distinct ProgramName 
 AVG(DATEDIFF(ss,StartDate,Enddate)) as AvgSec,
 MAX(DATEDIFF(ss,TimeStart,TimeEnd))as MaxSec,
 MIN(DATEDIFF(ss,TimeStart,TimeEnd))as MinSec,
 Count(*) as NumberOfRuns
 From ProgramExecutions WITH(NOLOCK)
 Group By ProgramName
 Order By AVG(DATEDIFF(ss,TimeStart,TimeEnd))DESC;

How would I be able to present what I am asking for in an SSRS report with the information that I have?


Solution

  • I ve actually managed to solve this by creating a parameter called Timeframe and giving it 4 specific values : Hourly, Daily, Weekly, Monthly and created 4 different graphs that are triggered to become visible accordingly. This was the best solution I could come up with and it works.