New to Telerik Reporting? Download free 30-day trial

Passing Culture Via AJAX Call From HTML5 Report Viewer


Product Progress® Telerik® Reporting
Project Type Web Application
Viewer HTML5 Viewer


How to pass the desired culture through an AJAX call from the HTML5 Report Viewer client to the server.


The culture that is respected server side is taken from the deviceInfo["CurrentCulture"] and deviceInfo["CurrentUICulture"] properties. If any of these properties are not provided, its value will be taken from the culture settings of the server. Currently, the properties could be modified in the event jQuery.ajaxPrefilter that changes the options of the AJAX request before sending it. The culture is added only in the request for creating the document. The following code adds a handler for the jQuery.ajaxPrefilter event that sets the culture to the desired one. The PlaceCultureStringHere variable should be a string representing a valid culture.

    $.ajaxPrefilter(function (options, originalOptions, jqXHR) {
        var str = originalOptions.url;
        var documentsSuffix = "documents";
        var isDocumentsUrl = (str.indexOf(documentsSuffix) == str.length - documentsSuffix.length);

        if (isDocumentsUrl) {
            var d = JSON.parse(;
            d.deviceInfo["CurrentCulture"] = PlaceCultureStringHere;
            d.deviceInfo["CurrentUICulture"] = PlaceCultureStringHere;
   = JSON.stringify(d);

The code could be placed in HTML5 Report Viewer's page.

In this article