简体   繁体   中英

Cascading Parameters Refresh in SSRS Report for Date Selection

I'm using SSRS report.

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.

How can I do this? Can anyone please help me.

Note: So I want the same behavior like onchange event.

  1. Create a new dataset with this query
    @ParamDate <-- is your selected Date Parameter's Name. select DATEADD(dd,14,@ParamDate) as NewDate

  2. Right click your "Start Date" parameter
    => Default Values
    => Select "Get Values from a query"
    => Select dataset created in (1)
    => Value Field: NewDate. 在此输入图像描述

  3. Done. 在此输入图像描述

Yes! I found the easy solution.

We need to create different Dataset . let's say I have created Dataset AddDaysDs .

AddDaysDs Dataset

SELECT DATEADD(dd ,14 ,@SelectdDate) AS StartDate

Inside Dataset , pass SelectdDate as a parameter to get 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

Same thing do inside Default Values of the same field.

Note: Ensure that all two parameters Advanced property must ticked as Always refresh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM