
Thanks in advance.
16 Answers, 1 is accepted
If you have set Culture only to the Report, please set the Culture of the CurrentThread and it should be displayed as you want.
The Culture of the CurrentThread is determined by the Regional Settings of the machine the application is running on.
Kind regards,
Steve
the Telerik team
HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Hello
How is this when using the HTML 5 report viewer?
The text box in the filter area always shows "MM/dd/yyyy" and the calendar "Wednesday, December 23, 2015". No matter of the thread culture ("de-CH") or the culture of the report (tested "Standard" or "de-CH").
Help would be appreciated!
Thx & regards
Please, check my post in Report Parameter DateTime Picker Format on UI.
Regards,
Stef
Telerik

Thanks Stef!
So to summarize:
Either use Kendo UI globalization (include Kendo culture script and use "kendo.culture("de-CH");")
Or else overwrite one / create your own custom parameter editor?
Does the report culture then still have any influence or does it overwrite the thread's culture (format of culture dependent fields)?
Regards

ATM I'm using report filters like "MyUserFunc(Fields.XYZ) >= IsNull(Parameters.DateFrom.Value, "1.1.1900")"

Hello
It appears that above filtering approach fails for english browsers. Even though thread's current (UI) culture is set to de / de-CH.
Solved this by using Date(y,m,d) (why is System.DateTime.MinValue not accessible?). But still dates are now presented in english format even though everything in the application / thread is set to (swiss) german.
Is this a bug in Telerik Reporting / HTML 5 viewer / web service, using the browser's language setting (what .NET already does if configured this way) instead of using the thread's culture setting?!? With the WebForms viewer this worked as expected, being able to change the report's language by switching the threads (UI) culture.
Thanks & Regards

Reports are processed and rendered on the server. If you use a localization with RESX files (Localizing Reports), in the report's designer.cs(vb) file you can see a standard resource manager that pulls resources from the corresponding RESX file. The RESX file will be determined based on the current thread's culture, which has to be set before creating an instance of the report (before the InitializeComponent method is called).
If youare using the HTML5 Viewer, the current thread's culture can be set on a request e.g. Localization in ASP.NET MVC 4.
With the above settings you will get the localized strings and the rendered with them report at the client.
In addition, you can localize the UI by using Kendo JS files per language or you can provide custom format in the page.
Please note that if you use a custom format for a widget (via property), the data will not use the format on submit. For example DataTime values can be formatted with slashes, dots and etc. on display, still the object will be transferred as a DateTime object to the server, and the string representation of this object on the server will depend on the server's culture settings; unless the data is transferred as a formatted string.
If you have the following expression in the report:
MyUserFunc(Fields.XYZ) >= IsNull(Parameters.DateFrom.Value, "1.1.1900")
I hope this information helps.
Regards,
Stef
Telerik

Hi Stef
I found out that setting the culture in the Global.asax for the report's localisation basically works the way we do.
The problem is that session is not available at the time of report processing. So the report viewer's thread is in the desired cultures while the thread rendering the report is in the browser's language.
For .ashx I had the same issue. I found out that this can be fixed by implementing "System.Web.SessionState.IReadOnlySessionState" in the .ashx, resulting in the session being available again in Global.asax.
Any suggestions how to achieve this for the thread rendering the report for the HTML 5 viewer?
(User's localization is read once into session at the beginning and is then retrieved from session later)
Thx!

Hi Stef
I further followed the steps in the description about HTML 5 report viewer localization. Do I see that right that there's no automisation for this and the viewer's thread's culture doesn't impact the viewer's localisation. Further "kendo.culture("de-CH");" isn't applicable for this and the desired "resources.xyz.js" has to be set/included manually?
Thx & regards

P.S.Noticed that the example resource file isn't complete respectively it only contains info and error msgs displayed by the report viewer but no other labels/descriptions of the UI.
- Are there complete samples and / or pre-translated files?
- What do you mean by "localize the UI by using Kendo JS files"? Do you have an example for HTML 5 report viewer and / or pre-translated files?
Thx!
In regards to your questions:
- Setting the thread's culture:
This has to be done before creating an instance of the report. If the report uses RESX files, in its InitializeComponent method will be created standard resource manager that takes the corresponding RESX based on the thread's culture.
Details how to set the culture per request is available in Localization in ASP.NET MVC 4 (external article).
In addition, the Reporting REST WebAPi based service is a standard WebAPi controller. If you want to use the current Session in it or in the report's constructor, the Session must be enabled for WebAPI controllers in general - Providing session state in ASP.NET WebAPI (codeproject article)
- HTML5 Viewer localization:
Please check HTML5 Viewer Localization. The added JS file will localize messages displayed by the viewer. If you want to localize the viewer's template, modify the provided viewer's HTML template and set the viewer's templateUrl to point to it instead of loading the default template from the service - Providing Templates.
There are no ready localized templates for the HTML5 viewer similar to Telerik Kendo UI culture scripts. Since the HTML5 viewer uses Telerik Kendo UI widgets in its template, you can use Telerik Kendo Ui localization for the widgets.
Regards,
Stef
Telerik

Hi Stef
Thanks for the articles!
But I still can't get it to work right with Session and WebApi as it seems.
Same place as the reporting resolver I created:
Public Class SessionableControllerHandler
Inherits Http.WebHost.HttpControllerHandler
Implements System.Web.SessionState.IRequiresSessionState ' IReadOnlySessionState
Public Sub New(routeData As RouteData)
MyBase.New(routeData)
End Sub
End Class
Public Class SessionStateRouteHandler
Implements Routing.IRouteHandler
' IRouteHandler_GetHttpHandler
Private Function GetHttpHandler(requestContext As RequestContext) As IHttpHandler Implements IRouteHandler.GetHttpHandler
Return New SessionableControllerHandler(requestContext.RouteData)
End Function
End Class
And in Global.asax in Application_Start() I tried:
'RouteTable.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}", New With {.id = Http.RouteParameter.Optional}).RouteHandler = New SessionStateRouteHandler()
and
RouteTable.Routes.MapHttpRoute(name:="DefaultApi", routeTemplate:="api/{controller}/{id}", defaults:=New With {Key .id = Http.RouteParameter.[Optional]}).RouteHandler = New SessionStateRouteHandler()
But the report itself appears still in the wrong language / format.
Please check the attached demo project that illustrates how to localize reports and the HTML5 Viewer. The language settings are based on Localization in ASP.NET MVC 4 (external article).
For more details, please check the links in my previous post.
Regards,
Stef
Telerik

Sure another way, a cookie, it is a good option, i prefer to register telerik web api with /xx/api/Reports, it is like the rest of our application.
It does not resolve the problem when the lang is a parameter of the report !
The standard localization of reports is based on RESX files and a resource manager that needs the current thread's culture to know which RESX file to be used. Thus the thread's culture must be set before initializing the report.
Report parameters are evaluated to late, after the report is initialized. If you want to localize reports based on a report parameter, then you can create user functions getting a string key of a resource and the report parameter, which functions return the localized string.
Regards,
Stef
Telerik by Progress