writing a SSRS report, how to set the value of the second parameter based on the results of choosing a value from the first parameter
-
Thursday, August 09, 2012 7:19 PM
writing a SSRS report, how to set the value of the second parameter based on the results of choosing a value from the first parameter
I have a list of dates I have available in the first parameter.
I want the value of the second parameter to be the value of the first parameter once a value (date) is selected.
I cannot get this to work. Both parameters are defined as date/time.
The first parameter has a list of preset dates. When I select the date I want from the first parameter I want that value to be placed into the second parameter because it is used in the query to determine the beginning date.
I have 2 datasets. The first supplied the list of available dates for the first parameter. The second dataset will get the value based on the value from the first parameter.
I do this because I want to second parameter to be flexible so I can either use the value from the first parameter or just choose any date based on the calendar.
Any help?
All Replies
-
Thursday, August 09, 2012 7:36 PM
Hi Jim,
You can achieve this using cascading parameters - http://msdn.microsoft.com/en-us/library/aa337498(v=sql.105).aspx
The second parameter should reference the first parameter in the data set you are using to populate the second parameter.
Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
-
Thursday, August 09, 2012 8:14 PM
Thanks for the reply. I am familiar with the example you are referring to. That deals with the result set based on the parameter.
However my situation is a bit different. I want to make the value in the second parameter be supplied from the first parameter.
I just cant get to work. I can have the default value of the second be based on the value of the first but when I change the value of the first parameter nothing seems to work.
screen shot of initial 'run', see below for second screen shot after i make a change to the first parameter called 'date ranges'.
First parameter = 'date ranges', second parameter = 'datefrom'. Initial setting ok but nothing works if i change the value in the first parameter.
see the 2 parameters, 1=date ranges and 2=datefrom
screen shot after I chose a new value from the first parameter. notice how the second parameter is now 'grayed out' and the first parameter did not retain the new value.
Whats up with this?
Jim Poindexter
-
Thursday, August 09, 2012 8:31 PM
screen shot after I chose a new value from the first parameter. notice how the second parameter is now 'grayed out' and the first parameter did not retain the new value.
Whats up with this?
Jim Poindexter
Hi,
Did you try selecting a value for the first parameter again after the second parameter is grayed out?
Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com
-
Thursday, August 09, 2012 8:49 PM
Yes, and always the same results. First parameter always goes back to 'select a value' (even though I already selected one) and the second parameter stays 'grayed out'. My thoughts on the second parameter being 'grayed out' is because of a data type mismatch, but I am positive I have both parameters defined as 'date/time' and the result is always a 'date/time' result.
Man the parameters sure do not want to play friendly.
Jim Poindexter
-
Thursday, August 09, 2012 9:31 PM
Well SSRS is just great.
If you change the data type from date/time to text, the parameters act OK. I can pass a value from the first parameter to the second parameter.
I guess the date/time data type does not allow any manipulation of the value.
Go figure.
Jim Poindexter
- Marked As Answer by jimpoindexter77 Thursday, August 09, 2012 9:54 PM

