This is a migrated thread and some comments may be shown as answers.

Restricting Date Type Parameter

1 Answer 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William Lim
Top achievements
Rank 1
William Lim asked on 10 Nov 2011, 08:25 AM
Is it possible to restrict the user input from selecting the date beyond the current date on a date-type report parameter? How should this be done?

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Nov 2011, 05:42 PM
Hello Chris,

Such functionality cannot be handled by the build-in report parameters which are not meant to be customized. Moreover, when you bind the DateTime parameter to a data source, it becomes a combobox with all the available dates, so there is no way for the user to go wrong and input a non existing date.
Your inquiry can only be applied to an unbound DateTime parameter, however you cannot specify a Min/Max value for it.
A possible solution for the time being would be to set the DateTime report parameters' visibility to false and create your own UI to handle the input e.g. use the RadDatePicker control with validators and pass the input via the report API:

Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report;
report.ReportParameters["MyParam"].Value = RadDatePicker1.SelectedDate;

Kind regards,
Steve
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

Tags
General Discussions
Asked by
William Lim
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or