1

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.

Community
  • 1
  • 1
Pedram
  • 6,256
  • 10
  • 65
  • 87

2 Answers2

2
  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

Marco Bong
  • 690
  • 4
  • 13
  • Good answer! but it will directly come up with selecting `added days` - what I want is if user select `Param Date :` then it should refresh the second date again. how can I do this? (like onchange event behavior) – Pedram Feb 02 '16 at 08:50
  • you can refer step(2) and do it under "Available Values", is that what you want ? Can't really understand "then it should refresh the second date again", what is the second date? – Marco Bong Feb 02 '16 at 08:55
  • not possible... still facing same issue. any other way I can achieve this? – Pedram Feb 02 '16 at 08:58
  • I don't think anyway can achieve like onchange event in ssrs default control, unless you use this report as local report, and do it from your web application. – Marco Bong Feb 02 '16 at 09:12
1

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

Pedram
  • 6,256
  • 10
  • 65
  • 87