I'm using version 18.104.22.1681 of Telerik.Reporting dll.
7 Answers, 1 is accepted
The DateTime Report Parameters UI by default only allows Date picking. Our suggestion in your case would be to create a custom UI for the parameters instead of using the default one. Just set the Report Parameters Visibility to False and add Windows Forms controls that will feed the Report Parameters in code behind, as shown in the following code snippet:All the best,
the Telerik team
private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
DateTime? date = ReportDatePicker.SelectedDate;
if (rvMain != null && date.HasValue)
DateTime beginDate = date.Value.AddHours(-10); //setting range from 2pm to 2pm
DateTime endDate = date.Value.AddHours(14);
var report = new DealerDetails();
report.ReportParameters["BeginDate"].Value = beginDate;
report.ReportParameters["EndDate"].Value = endDate;
rvMain.ReportSource = report;
Generally you can keep the default report parameter and only modify the report parameter value with expression in the report definition directly. For example:
Still if you prefer to utilize your own parameters UI with MVVM in mind our suggestion is to use Data Binding for the Datepicker.Value and ReportViewer.ReportSource. Then from your ViewModel property that is binded to the Datepicker.Value you have to trigger property changed for the property that is binded to the ReportViewer.ReportSource with an updated ReportSource.Parameters.
DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.