Skip to main content
All docs
V25.1
  • TdxReport.Language Property

    Specifies the required language (for UI and report localization).

    Declaration

    property Language: string read; write;

    Property Value

    Type Description
    string

    The target culture name for UI and report localization.

    Refer to the following topic for the full list of culture names: Language Culture Names, Codes, and ISO Values.

    Remarks

    Use the Language property to switch between available languages for the Report Designer/Report Viewer UI and report layouts / resulting reports.

    Note

    The Language property is ignored if UI localization strings are missing for the corresponding language.

    Add UI Localization Strings for Report Viewer and Designer Dialogs

    Web-based Report Designer and Report Viewer dialogs support JSON localization strings obtained from the DevExpress Localization Service. You can use the Language property to switch between multiple languages in the UI if the following JSON files for every target language are present in the Localization folder located in the same directory as the application executable:

    • dx-reporting-core.xx.json
    • dx-reporting-xx.json

    Note

    xx is replaced with the target language identifier. For example, de corresponds to German, el – to Greek, etc.

    Refer to the following help topics for detailed instructions on Report UI localization:

    Localize Reports

    The Language property allows you to switch between multiple languages for a report if corresponding localized values are stored in the report template layout (in the XML-like REPX format).

    Refer to the following help topic for detailed information on report content localization:

    Localize ASP.NET Core Reporting Components: Localize Reports

    Code Examples

    View Example: Localize the DevExpress Viewer and Report Designer

    Change Report Language

    This code example loads an XML-based report template (REPX) from a dataset, configures export settings, populates the template with data from another dataset, and displays the report preview:

    uses
      dxReport,  // Declares the TdxReport component and related types
      dxReport.ConnectionString.JSON.DB;  // Declares the TdxReportDataSetJSONConnection component
    // ...
    
    procedure TMyForm.Button1Click(Sender: TObject);
    var
      ADataConnection: TdxReportDataSetJSONConnection;
      AReport: TdxReport;
      ALayoutStream: TStream;
    begin
      ADataConnection := TdxReportDataSetJSONConnection.Create(Self);
      try
        ADataConnection.Name := 'DataSetJSONData';
        ADataConnection.DataSets.Add('Data', FDataSet);
        AReport := TdxReport.Create(Self);
        try
          AReport.ReportName := 'Report';
          ALayoutStream := FLayoutDataSet.CreateBlobStream(FLayoutDataSet.FieldByName('Layout'), bmRead);
          try
            AReport.Layout.LoadFromStream(ALayoutStream);
          finally
            ALayoutStream.Free;
          end;
          AReport.Language := 'fr-FR';
          AReport.ExportFormats := [TdxReportExportFormat.PDF,
            TdxReportExportFormat.RTF, TdxReportExportFormat.HTML];
          AReport.FilterString := 'id = 5';
          AReport.ShowViewer;
        finally
          AReport.Free;
        end;
      finally
        ADataConnection.Free;
      end;
    end;
    

    Default Value

    The Language property’s default value is an empty string.

    The default Language property value indicates the en-US culture.

    See Also