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

How to Pass calendar control in the Report Viewer

5 Answers 237 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 08 Jul 2010, 01:08 PM
I am having the question how to pass the Date parameter in the Report viewer ? Other than drop down values can we pass the calendar control in the header and filter the data ?

Please advise.

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 12 Jul 2010, 06:23 PM
Hi Paul,

The Report Parameters supports the most important data types including Date. In order to activate the Report Parameter UI to show a calendar control you have to set the Report Parameter's Type property to DateTime. If you need additional control over the Report Parameter's UI you can easily create a custom UI as illustrated in the attached sample project.

All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul Coakley
Top achievements
Rank 2
answered on 01 Dec 2010, 04:50 PM
Hi,

This isn't really ideal - is it possible to get the auto-generated ui to use the RadDatePicker control for date fields? No doubt I can do this the hard way, but I have numerous parameters already and I would really prefer not to have to reimplement all of those as well. Plus in doing so I'd lose the automatic generation, so that changes to the report definition, say adding another parameter or changing a data source and default value would need to be reimplemented against every viewer.

I'm going to have a dig around how the parameter UI is generated now and see where there may be entry points to achieve this, but if you have any suggestions they'd be much appreciated.

Many Thanks
0
Paul Coakley
Top achievements
Rank 2
answered on 02 Dec 2010, 10:02 AM
Well, I've managed to replace the calendar popup with a RadCalendar and got it loading / saving dates by setting calendarFrameSrc on the ReportViewer object in javascript and then hooking in to the same scripts the reportviewer uses against the standard ASP.NET calendar. Seems to work really well, but I know this isn't a long term solution and there's nothing to stop Q4 coming along and breaking it.

And I haven't been able to swap out the popup button for the RadDatePicker resource yet as I wanted to avoid having to hack the DOM via jQuery.

I can share this code if you like, plus got a few suggestions - there seem to be a few places where this could have been made *much* easier from the reportviewer end. I derived from the ReportViewer in the end, but was a little disappointed to not find a suitable place to swap out editor controls, or override a "create parameter editor" method. I didn't quite work out how the different iframes related back to the same reportviewer object - is this what the instanceID is for? in Session or Cache perhaps?

anyway, I've covered the business requirement so further discussion is academic really for now, but I'm still happy to have the discussion.
0
Jayanth
Top achievements
Rank 1
answered on 19 Jun 2014, 10:16 AM
Hi Paul,

Can you Share the Code to replace Calendar popup with a RAD Calendar.

regards
Jayanth
0
Stef
Telerik team
answered on 23 Jun 2014, 12:26 PM
Hi Jayanth,

You can hide the DateTime parameter from the default viewer's parameters area, and add custom UI in the viewer's toolbar or elsewhere that handles the values for the parameter.

If you switch to the new HTML5 Report Viewer (introduced as of Q3 2013), you can create custom editors for parameters in the viewer's parameters area.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Peter
Telerik team
Paul Coakley
Top achievements
Rank 2
Jayanth
Top achievements
Rank 1
Stef
Telerik team
Share this question
or