1
votes

I'm using SSRS report.

How to set another parameters default date based on first selected date. Please see the below image.

enter image description here

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.

2

2 Answers

2
votes
  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. enter image description here

  3. Done. enter image description here

1
votes

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