How to disable the future dates in Date pick calendar - SQL Server Reporting Services
Hi All,
I have a scenario to run the report only for the Past days, and i have datepick calendar as a parameter for selecting Start Date and End Date. I want to control the Users by not to select the Future Dates in the End Date. In Other Words, the user should not select beyond the Current Date,
Is there any way for me to control it. Advance Thanks
Regards,
Sundarrajan.
November 16th, 2009 6:38am
Hi Sundarrajan,By default, there is no way to disable the future dates for the Date pick calendar in SQL server reporting services. But, you can do something tovalidate the date parameter value before report rendered, ifthe date valuebeyonds now, a message is shown to prompt the usersthe date enteredinvalidated,otherwise, the report works normally based on thedate parameter selected.Read this thread http://social.msdn.microsoft.com/forums/en-US/sqlreportingservices/thread/8736ed6d-27f8-49ce-bbfa-718f4f4daa45/for some workarounds to achieve this.I recommad the 1st one of theways provided byLukasz Pawlowski. Please don't use the messbox way, which desn't work in web due to it is only supported in window form platform.thanks,Jerry
Free Windows Admin Tool Kit Click here and download it now
November 17th, 2009 9:31pm
Hi Sundarrajan..
Here is a solution for ur problem: put the below code in the script, and the add
OnClientDateSelectionChanged="checkDate" in the calenderExtender... u ll get the answer nicely.. Happy coding..
<script type="text/javascript">
function checkDate(sender,args){
alert("You cannot select a day greater than today!")
sender._selectedDate = new Date();
sender._textbox.set_Value(sender.selectedDate.format(sender._format))
}
}</script>
September 18th, 2012 8:28am
Is thr any possibilities to disable the future dates without using the message box alert method??? could anyone pls help me in this???
Thanks in advance!
mercyaqvin.
Free Windows Admin Tool Kit Click here and download it now
September 18th, 2012 8:30am