SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Can I Enable/Disable a date parameter?


Can I Enable/Disable a date parameter?

Author
Message
FunkyDexter
FunkyDexter
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1822 Visits: 1074
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?
anthony.green
anthony.green
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62310 Visits: 8579
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



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
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


FunkyDexter
FunkyDexter
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1822 Visits: 1074
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?
anthony.green
anthony.green
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62310 Visits: 8579
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.



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
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger


FunkyDexter
FunkyDexter
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1822 Visits: 1074
Oh well, I liked the thinking anyway Smile
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum







































































































































































SQLServerCentral


Search