February 11, 2014 at 1:41 am
SQL SERVER Version: 2008 R2
I have two Report Parameters that are not cascaded in my SSRS Report.
- The first parameter is a Year.
- The second parameter is a drop-down with values "Month" and "Quarter" - to basically ask the user if they want the Monthly or Quarterly data.
I want the second parameter to be enabled only if the user selects a value from the first parameter.
Since the stored procedure invoked from the report expects value from both those parameters, I'm trying to prevent the error which would occur incase the user just selects a value for second parameter but not for the first parameter.
Question 1:
Is there a option to disable the 2nd report parameter until user selects a value for the 1st Report Parameter?
Question 2:
I tried the following approach and it works, but I'm not sure if this approach would cause any side-effects.
Can someone let me know if this approach is appropriate?
I have 2 available values set for the 2nd Report parameter.
Label: Month Value: Month
Label: Quarter Value: Quarter
Instead of the value Month, I'm using the expression:
=IIf((Not(IsNothing(Parameters!Year.Value))),"Month","")
Is this appropriate?
Thanks!
February 11, 2014 at 4:42 am
you have to use a data source for the second parameter that is configured to use a value from the first parameter
the second parameter should load/populate automatically that is you should set the parameter to have a default value from this dataset and available values also from this dataset.
on this dataset you should populate all possible values for the years i.e. 2011, 2012, 2013, 2014
also for the quarters if needed i.e. Qtr1 2013, Qtr2 2013, e.t.c
also for all months i.e. Jan 2013 , Feb 2013 , Jan 2014 e.t.c, all these values to be on the same dataset and also add a column on this dataset that has corresponding values to the selections,
i.e. the column name can be FilterBy such that
FilterBy | selection | StartDate | e.t.c columns
Year | 2011 | 2011-01-01 | e.t.c
Year | 2012 | 2012-01-01 | e.t.c
Year | 2013 | 2013-01-01 | e.t.c
Year | e.t.c | e.t.c | e.t.c
Month | January 2013 | 2013-01-01 | e.t.c
Month | February 2013 | 2013-02-01 | e.t.c
Month | March 2013 | 2013-03-01 | e.t.c
Month | e.t.c | e.t.c | e.t.c
Month | e.t.c | e.t.c | e.t.c
Month | e.t.c | e.t.c | e.t.c
the first parameter should have just year, month e.t.c
then apply a filter on dataset such that wehn month is selected on first parameter then available values on second parameter should be months.
...hope this helps.......
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply