Solved

SSRS enable Report Parameter only when another Report Parameter is selected

Posted on 2014-02-11
5
2,032 Views
1 Endorsement
Last Modified: 2014-02-25
Hello,

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

Open in new window


Instead of the value Month, I'm using the expression:
=IIf((Not(IsNothing(Parameters!Year.Value))),"Month","")

Open in new window


Is this appropriate?
1
Comment
Question by:sath350163
5 Comments
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 200 total points
ID: 39849496
Is there a option to disable the 2nd report parameter until user selects a value for the 1st Report Parameter?

Not really.  The only functionality that simulates this is cascading parameters.

But... why don't you just specify defaults for both parameters and disallow NULL/blank?  In that case you would avoid the situation for which you're trying to find a solution...
0
 
LVL 37

Assisted Solution

by:ValentinoV
ValentinoV earned 200 total points
ID: 39849502
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.

As long as you don't have the Allow blank value or Allow null value checkboxes activated the report will always require both parameters to have a value before the call to your main stored proc is made, so what you've described should normally never occur.
0
 

Author Comment

by:sath350163
ID: 39849533
Thank you for the response.

- Cascading would not work in my case, as those two Report Parameters are not dependent.

The 1st parameter year has the last 5 years in the drop-down.
The 2nd parameter has 2 static values "Month" and "Quarter", which is not dependent on the 1st Report Parameter Year.


- My requirement does not allow default values to be set for the Report Parameters.
I want to even avoid the Parameter error that pops up when I try to preview my report by selecting a value for the 2nd parameter while not selecting a value for the 1st parameter.



Thanks!
0
 
LVL 12

Assisted Solution

by:Koen Van Wielink
Koen Van Wielink earned 150 total points
ID: 39849545
What if you fill in a default value for the first parameter? Like the current year? That way, the user cannot forget to fill it and you won't get an error either.
0
 
LVL 65

Accepted Solution

by:
Jim Horn earned 150 total points
ID: 39849967
>I want the second parameter to be enabled only if the user selects a value from the first parameter.

As VV stated above it can't be done, but one workaround would be to rewrite the SP that feeds the dropdown in the second query, so that if Year is passed, the only allowable value is <ALL>, instead of 'Month' and 'Quarter'.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Time Duration able to handle overflow of 24+ hours 5 39
grouping logic 6 46
Add total to a tablix with ReportItem values 15 36
SQL Server - Slabs 9 36
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now