[英]Cascading Parameters Refresh in SSRS Report for Date Selection
I'm using SSRS report. 我正在使用SSRS报告。
How to set another parameters default date based on first selected date. 如何根据第一个选定日期设置其他参数默认日期。 Please see the below image. 请看下面的图片。
Here, when I will select Date value as 02-01-16
I wanted to add 14days to this date and then I want to set this updated date to Start Date
parameter. 在这里,当我选择日期值为02-01-16
我想在此日期添加14天,然后我想将此更新日期设置为Start Date
参数。
How can I do this? 我怎样才能做到这一点? Can anyone please help me. 谁能帮帮我吗。
Note: So I want the same behavior like onchange event. 注意: 所以我想要像onchange事件一样的行为。
Create a new dataset with this query 使用此查询创建新数据集
@ParamDate <-- is your selected Date Parameter's Name. @ParamDate < - 是您选择的日期参数名称。 select DATEADD(dd,14,@ParamDate) as NewDate 选择DATEADD(dd,14,@ ParamDate)作为NewDate
Right click your "Start Date" parameter 右键单击“开始日期”参数
=> Default Values =>默认值
=> Select "Get Values from a query" >>选择“从查询中获取值”
=> Select dataset created in (1) =>选择在(1)中创建的数据集
=> Value Field: NewDate. =>值字段:NewDate。
Yes! 是! I found the easy solution. 我找到了简单的解决方案。
We need to create different Dataset
. 我们需要创建不同的Dataset
。 let's say I have created Dataset AddDaysDs
. 假设我已经创建了Dataset AddDaysDs
。
AddDaysDs Dataset AddDaysDs数据集
SELECT DATEADD(dd ,14 ,@SelectdDate) AS StartDate
Inside Dataset
, pass SelectdDate
as a parameter to get StartDate
. 在Dataset
内部,将SelectdDate
作为参数传递给StartDate
。
Now, Right click on StartDate
parameter and then goto Parameter properties then inside Available values tick Get values from a query and set dataset AddDaysDs
现在, 右键单击 StartDate
参数然后转到参数属性然后在可用值内勾选从查询中获取值并设置数据集AddDaysDs
Same thing do inside Default Values
of the same field. 同一字段的Default Values
内部也是如此。
Note: Ensure that all two parameters Advanced
property must ticked as Always refresh
注意:确保所有两个参数Advanced
属性必须勾选为Always refresh
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.