Back to Devexpress

DxReportDesignerCallbacks.CustomizeLocalization Property

xtrareports-devexpress-dot-blazor-dot-reporting-dot-dxreportdesignercallbacks.md

latest3.3 KB
Original Source

DxReportDesignerCallbacks.CustomizeLocalization Property

Specifies the JavaScript function that handles the Web Report Designer’s CustomizeLocalization client-side event.

Namespace : DevExpress.Blazor.Reporting

Assembly : DevExpress.Blazor.Reporting.v25.2.JSBasedControls.Common.dll

NuGet Package : DevExpress.Blazor.Reporting.JSBasedControls.Common

Declaration

csharp
[Parameter]
public string CustomizeLocalization { get; set; }
vb
<Parameter>
Public Property CustomizeLocalization As String

Property Value

TypeDescription
String

The name of a JavaScript function used to handle the CustomizeLocalization event.

|

Remarks

The CustomizeLocalization event enables you to localize the Web Report Designer. Use the event argument’s LoadMessages method to load JSON files obtained from the DevExpress Localization Service.

The code below applies the German localized resources from JSON files. Localization files are in the wwwroot/localization folder.

javascript
window.DesignerCustomization = {
    //Apply German localization.
    onCustomizeLocalization: function(s, e) {
        $.get("/localization/de.json").done(result => {
            e.WidgetLocalization.loadMessages(result);
        }).always(() => {
            e.WidgetLocalization.locale("de");
        })

        e.LoadMessages($.get("/localization/dx-analytics-core.de.json"));
        e.LoadMessages($.get("/localization/dx-reporting.de.json"));
        e.LoadMessages($.get("/localization/dx-rich.de.json"));

    }
}
razor
<head>
    @...@
    @DxResourceManager.RegisterScripts((config) => config.Register(new DxResource("/customization.js", 900)))
    @...@
</head>
razor
<DxReportDesigner ReportName="SampleReport" Height="1000px" Width="100%">
       <DxReportDesignerClientSideModelSettings IncludeLocalization="false" />
    <DxReportDesignerCallbacks CustomizeLocalization="DesignerCustomization.onCustomizeLocalization" />
</DxReportDesigner>

For information on how to obtain the JSON localization files, refer to the following help topic: Localize ASP.NET Core Reporting Components.

See Also

DxReportDesignerCallbacks Class

DxReportDesignerCallbacks Members

DevExpress.Blazor.Reporting Namespace