有没有办法在 SSRS 报告中创建图表,用户可以在其中选择变量范围?
is there a way to create a graph in an SSRS report where the user can choose between ranges of a variable?
基本上,我需要显示一段时间内程序的执行趋势,如果用户想查看 month/week/daily/hourly 数据,他们可以 select。
所以我有一个名为 ProgramExecutions 的 table,其中包含以下列:
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
然后我有以下针对此 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;
我如何能够使用我所拥有的信息在 SSRS 报告中呈现我所要求的内容?
我实际上已经设法解决了这个问题,方法是创建一个名为 Timeframe 的参数并为其指定 4 个特定值:每小时、每天、每周、每月,并创建了 4 个不同的图表,这些图表被触发后相应地可见。这是我能想出的最好的解决方案,而且有效。
基本上,我需要显示一段时间内程序的执行趋势,如果用户想查看 month/week/daily/hourly 数据,他们可以 select。
所以我有一个名为 ProgramExecutions 的 table,其中包含以下列:
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
然后我有以下针对此 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;
我如何能够使用我所拥有的信息在 SSRS 报告中呈现我所要求的内容?
我实际上已经设法解决了这个问题,方法是创建一个名为 Timeframe 的参数并为其指定 4 个特定值:每小时、每天、每周、每月,并创建了 4 个不同的图表,这些图表被触发后相应地可见。这是我能想出的最好的解决方案,而且有效。