Skip to main content
All docs
V25.1
  • Localizing Your DevExpress-powered .NET App – Your Feedback Matters

    We hope to validate a few hypotheses about our Localization Service, Unified Component Installer, overall localization quality, and ways to translate strings in general.

    Take the survey Not interested

    DxBlazorReportViewerLocalizerLocalizationService Class

    Allows you to change localizable text at runtime.

    Namespace: DevExpress.Blazor.Reporting.Localization

    Assembly: DevExpress.Blazor.Reporting.v25.1.Viewer.dll

    NuGet Package: DevExpress.Blazor.Reporting.Viewer

    #Declaration

    public class DxBlazorReportViewerLocalizerLocalizationService :
        DxBlazorViewerLocalizerLocalizationService,
        IDxReportingLocalizationService,
        IDxViewerLocalizationService,
        IDxLocalizationService

    #Remarks

    The DxBlazorReportViewerStringId enumeration lists the Report Viewer’s localizable strings. You can implement and register a custom service to replace a specific localizable string with custom text at runtime.

    For this, create a custom class CustomLocalizationService that inherits from the DxBlazorReportViewerLocalizerLocalizationService class and override the GetString method:

    cs
    using DevExpress.Blazor.Reporting.Localization;
    // ...
        public class CustomLocalizationService: DxBlazorReportViewerLocalizerLocalizationService
        {
            protected override string GetString(string key)
            {
                switch (key)
                {
                    case "DxBlazorReportViewerStringId.TabPanel_Parameters_Title":
                        return "Please specify your report parameters";
                        break;
                    default:
                        return base.GetString(key);
                        break;
                }
            }            
        }
    

    Register the CustomLocalizationService at application startup:

    using Microsoft.AspNetCore.Hosting;
    using DevExpress.Blazor.Reporting.Localization;
    
    var builder = WebApplication.CreateBuilder(args);
    
    builder.Services.AddScoped<IDxReportingLocalizationService, CustomLocalizationService>();
    
    var app = builder.Build();
    

    The result is shown in the following image:

    Blazor Report Viewer Localized

    #Inheritance

    Object
    DxBlazorViewerLocalizerLocalizationService
    DxBlazorReportViewerLocalizerLocalizationService
    See Also