Solved

SSRS enable Report Parameter only when another Report Parameter is selected

Posted on 2014-02-11
5
2,280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 13

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 66

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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

622 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