Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Hi Telerik Team,
I'm using Telerik Reporting in an ASP.NET MVC application. I have a generic helper method to configure the Telerik Report Viewer using a UriReportSource. Here's the function:
UriReportSource
public static class ReportExtension { public static IReportViewerBuilder GetReportViewerConfig(this HtmlHelper htmlHelper, string reportId, string reportSource, Dictionary<string, string> reportParams) { var uriReportSource = new UriReportSource { Uri = reportSource }; foreach (var param in reportParams) { uriReportSource.Parameters.Add(param.Key, param.Value); } return htmlHelper.TelerikReporting().ReportViewer() .Id(reportId) .ReportServer(new ReportServer() { Url = ReadConfigData.REPORT_SERVER_URL, Username = ReadConfigData.REPORT_SERVER_USERNAME, Password = ReadConfigData.REPORT_SERVER_PASSWORD }) .ReportSource(uriReportSource) .ViewMode(ViewMode.Interactive) .ScaleMode(ScaleMode.FitPageWidth) .PersistSession(false) .SendEmail(new SendEmail { Enabled = true }) .Parameters(new Parameters { Editors = new Editors { MultiSelect = EditorTypes.ComboBox, SingleSelect = EditorTypes.ComboBox } }) .EnableAccessibility(false); } }The Problem:I'm using DateTime parameters (e.g., dateFrom, dateUntil) in my reports, and they appear in the report parameter panel with the format MM/dd/yyyy. I want to show these dates as dd/MM/yyyy. My Questions:1. Is it possible to customize the display format (e.g., dd/MM/yyyy) of DateTime parameters in the parameter input panel?2. If not, is there any workaround — such as setting culture explicitly for the viewer?Regards,Prabesh Shrestha
public static class ReportExtension { public static IReportViewerBuilder GetReportViewerConfig(this HtmlHelper htmlHelper, string reportId, string reportSource, Dictionary<string, string> reportParams) { var uriReportSource = new UriReportSource { Uri = reportSource }; foreach (var param in reportParams) { uriReportSource.Parameters.Add(param.Key, param.Value); } return htmlHelper.TelerikReporting().ReportViewer() .Id(reportId) .ReportServer(new ReportServer() { Url = ReadConfigData.REPORT_SERVER_URL, Username = ReadConfigData.REPORT_SERVER_USERNAME, Password = ReadConfigData.REPORT_SERVER_PASSWORD }) .ReportSource(uriReportSource) .ViewMode(ViewMode.Interactive) .ScaleMode(ScaleMode.FitPageWidth) .PersistSession(false) .SendEmail(new SendEmail { Enabled = true }) .Parameters(new Parameters { Editors = new Editors { MultiSelect = EditorTypes.ComboBox, SingleSelect = EditorTypes.ComboBox } }) .EnableAccessibility(false); } }
I'm using DateTime parameters (e.g., dateFrom, dateUntil) in my reports, and they appear in the report
DateTime
dateFrom
dateUntil
parameter panel with the format MM/dd/yyyy. I want to show these dates as dd/MM/yyyy.
1. Is it possible to customize the display format (e.g., dd/MM/yyyy) of DateTime parameters in the parameter input panel?
2. If not, is there any workaround — such as setting culture explicitly for the viewer?Regards,
Prabesh Shrestha
Hello Prabesh,
Yes, it is possible to customize the Date Format of the DateTime parameters in the Report Viewer. For details, please see How to change report parameter date format in HTML5 MVC Report Viewer, which describes two possible solutions.
I hope this helps.
Regards, Justin Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.