Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

IGlobalizationService Interface

In This Article

Enables you to customize globalization settings of the current thread (including thread impersonation).

Namespace: DevExpress.XtraReports.Web.ClientControls

Assembly: DevExpress.XtraReports.v24.2.Web.dll

NuGet Package: DevExpress.Web.Reporting.Common

#Declaration

public interface IGlobalizationService

#Remarks

When a web server processes requests coming from the Query Builder, End-User Report Designer or Web Document Viewer, a full page postback does not occur, which enables faster processing of such requests.

To register a custom globalization service, provide a custom IGlobalizationService implementation and register it by calling the DefaultClientControlContainer.UseCustomGlobalizationService<T> method at the application startup.

using System.Globalization;
using System.Threading;
using DevExpress.XtraReports.Web.ClientControls;
// ...

public class CustomGlobalizationService : IGlobalizationService {
    public void UpdateCultures(string[] userLanguagesFromClient) {
        CultureInfo currentCulture = GetCultureInfo(userLanguagesFromClient);
        Thread.CurrentThread.CurrentCulture = currentCulture;
        Thread.CurrentThread.CurrentUICulture = currentCulture;
    }
}

You can register your globalization service using the DefaultClientControlContainer.UseCustomGlobalizationService<T> method at the applicaton startup.

using DevExpress.XtraReports.Web.ClientControls;
// using DevExpress.XtraReports.Web.QueryBuilder.Native;
// using DevExpress.XtraReports.Web.WebDocumentViewer.Native;
// using DevExpress.XtraReports.Web.ReportDesigner.Native;
// ...

protected void Application_Start(object sender, System.EventArgs e)
    // QueryBuilderBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.ReadOnly;
    // ReportDesignerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.ReadOnly;
    // WebDocumentViewerBootstrapper.SessionState = System.Web.SessionState.SessionStateBehavior.ReadOnly;
    DefaultClientControlContainer.UseCustomGlobalizationService<CustomGlobalizationService>();
    // ...
}

If you are using the ASP.NET session state in your application, assign an appropriate value to the static SessionState property of the required bootstrapper classes.

Additionally, to be able to access the session state from your IGlobalizationService implementation, add the following lines to the application’s configuration file.

<system.web>
  <httpHandlers>
    <add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v16.2, Version=16.1.0.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="DXXRDV.axd" validate="false" />
    ...
  </httpHandlers>
</system.web>

<system.webServer>
  <handlers>
    <add type="DevExpress.Web.ASPxHttpHandlerModule, DevExpress.Web.v16.2, Version=16.1.0.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="DXXRDV.axd" name="ASPxViewerHttpHandlerModule" preCondition="integratedMode" />
    ...
  </handlers>
</system.webServer>
See Also