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

Calendar for date parameter

6 Answers 205 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 08 Oct 2011, 09:28 PM
When I preview my report, I get the nice Telerik calendar control for my date parameter but in the web browser, I get the ugly HTML calendar which has no year selection etc.

What could I be doing wrong?
I have the Telerik Web UI DLL in my bin folder and the proper reporting dll

6 Answers, 1 is accepted

Sort by
0
IvanDT
Telerik team
answered on 11 Oct 2011, 05:12 PM
Hello Bill,

The Preview in Visual Studio uses the Windows Forms Report Viewer, while when you view a report in a web page, you utilize the Web Report Viewer. The latter is a web control which utilizes the standard asp:Calendar control (not Telerik DateTimePicker) for its DataTime report parameter i.e. it is not a highly customizable control that allows to be styled. Additionally the report parameter area is in a separate iframe which makes the task of styling it impossible. The Report Parameter area provides out of the box UI support for the parameters that covers 98% of the user cases and for that reason it is not customizable. In order to achieve your requirement, you should create custom UI for the parameters and hook it up to the parameters via the Reporting API.

Greetings,

IvanDT
the Telerik team

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

0
David
Top achievements
Rank 1
answered on 10 Jan 2012, 01:41 AM
This is actually very dissappointing, since I tried the reporting module and bought it based on the preview look and feel of the reports.  Is there a way to gather an example on how to replace the standard calendar control with the radCalendar control?  I have spent a great deal of time trying to figure out why the calendar parameter UI was not formatted correctly until I run into this post.  Any help will be greatly appreciated.
0
Bill
Top achievements
Rank 1
answered on 11 Jan 2012, 06:13 PM
As Telerik suggested, I decided to scrap using the built in parameter functionality as it is just too flimsy and time consuming to tweak.
I simply added my own gui for filtering and filtered my datasource based on that.
So much easier and less headaches.
As a matter of fact for the most part I just re-used the filtering gui I had already created for the web page so when they open the report, it uses the same filtering.
0
Steve
Telerik team
answered on 12 Jan 2012, 03:45 PM
Hello David,

The built-in report parameters' purpose is to provide basic UI that is available out of the box and that is enough for most scenarios. For other cases, when you require customization, you can hide all report parameters (Visible=false), create a custom parameter area and wire it up to the Report API e.g. use RadDatePicker for ASP.NET AJAX control and pass the input via the report API:
Copy Code
Copy Code
Telerik.Reporting.Report report = (Telerik.Reporting.Report)this.ReportViewer1.Report;
report.ReportParameters["MyParam"].Value = RadDatePicker1.SelectedDate;


Kind regards,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Ben
Top achievements
Rank 1
answered on 13 Mar 2015, 08:08 PM
Would be nice to have an example of wiring custom parameters to the Report API instead of just stating this!!!!!!
0
Stef
Telerik team
answered on 18 Mar 2015, 01:50 PM
Hello Robert,

The ASP.NET ReportViewer parameters area is immutable, thus using a custom UI is the approach for getting customizable parameters editors.

For example use your own controls, and once the user saves the selection update the viewer's Reportsource.Parameters collection. The ReportSource.Parameters collection is mapped by key to the wrapped report's ReportParameters collection.
For example:
protected void SubmitButton_Click(object sender, EventArgs e)
{
        var newValue = DropDown1.SelectedValue;
        if (ReportViewer1.ReportSource.Parameters.Contains("Parameter1"))
                        {
                            ReportViewer1.ReportSource.Parameters["Parameter1"].Value = newValue;
                        }
                        else
                            ReportViewer1.ReportSource.Parameters.Add("Parameter1", newValue);
}


In a web application, my recommendation is to use the HTML5 Report Viewer and the Reporting REST service available as of Telerik Reporting Q3 2013. The HTML5 viewer's parameters editors can be customized via Javascript.
Examples with the viewer are available in the local Html5Demo and MvcDemo projects.


I hope the provided information helps you.

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
Bill
Top achievements
Rank 1
Answers by
IvanDT
Telerik team
David
Top achievements
Rank 1
Bill
Top achievements
Rank 1
Steve
Telerik team
Ben
Top achievements
Rank 1
Stef
Telerik team
Share this question
or