Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Can I Enable/Disable a date parameter? Expand / Collapse
Author
Message
Posted Thursday, November 15, 2012 3:19 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 6:02 AM
Points: 125, Visits: 674
Hi All

Using SSRS 2008.

I have a report where a user can view either open or closed jobs. If they're viewing closed jobs they will view jobs closed within a date range they select. If they're viewing open jobs they will simply view all open jobs, no date range required.

So I want to enable/disable the date parameters based on what they pick in the "Open/Closed" parameter. I can live with them having the date range available to select if they pick open but, since it's going to be ignored it just feels a bit yucky. This feels like it should be easy to resolve and I'm probably missing the obvious but I just can't seem to think of a way to do this. Any suggestions?

Post #1385036
Posted Thursday, November 15, 2012 3:26 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, October 13, 2014 6:42 AM
Points: 5,216, Visits: 5,111
You would use the hidden property of the parameters based on the value selected by the open/closed parameter.

Use an expression like

=IIF(Parameters!OpenClosed.Value = "Open", TRUE, FALSE)

You will need to ensure that your parameter order in the report is such that OpenClosed is above the date parameters




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1385042
Posted Friday, November 16, 2012 1:47 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 6:02 AM
Points: 125, Visits: 674
Parameters don't have a hidden property as such do they? You've got the visibility option which is a radio button selection but there's nowhere to enter an expression.

Am I missing something because that sounds like it would be ideal otherwise?
Post #1385538
Posted Friday, November 16, 2012 2:00 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, October 13, 2014 6:42 AM
Points: 5,216, Visits: 5,111
Doh, yeah I was getting confused with the hidden properties as I knew it had one but forgot it doesnt have a true properties section, I tried to hack the xml of a test report to build in a IIF expression on a parameter but it issues a type error detailing that its not a boolean value.





Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1385544
Posted Friday, November 16, 2012 3:27 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Yesterday @ 6:02 AM
Points: 125, Visits: 674
Oh well, I liked the thinking anyway :)
Post #1385580
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse