|
1 | 1 | <!-- default badges list --> |
2 | 2 |  |
3 | 3 | [](https://supportcenter.devexpress.com/ticket/details/T1305951) |
4 | | -[](https://docs.devexpress.com/GeneralInformation/403183) |
| 4 | +[](https://docs.devexpress.com/GeneralInformation/403183/help-resources/devexpress-code-examples) |
5 | 5 | [](#does-this-example-address-your-development-requirementsobjectives) |
6 | 6 | <!-- default badges end --> |
7 | | -# DevExpress VCL Reports - Localize the DevExpress Report Viewer and Report Designer |
8 | 7 |
|
9 | | -This example localizes DevExpress VCL [Report Viewer](https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer)/[Report Designer](https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer) dialogs ([TdxReport](https://docs.devexpress.com/VCL/dxReport.TdxReport) component). German UI localization strings are stored within the project's [Localization](https://github.com/DevExpress-Examples/vcl-reports-localize/tree/25.1.4%2B/Localization) folder as JSON files. You can download UI localizations for additional languages from the [DevExpress Localization Service](https://localization.devexpress.com/). |
| 8 | +# DevExpress VCL Reports—Localize the Report Viewer and Report Designer |
10 | 9 |
|
11 | | -<img width="1049" height="697" alt="vcl-reports-tdxreport-report-viewer-localization" src="https://github.com/user-attachments/assets/8e2366ae-501e-4b53-a8d9-865ba7155a2c" /> |
| 10 | +This example localizes DevExpress VCL Reports components. |
| 11 | + |
| 12 | +The [DevExpress Reporting Platform](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports) has full support for UI localization. |
| 13 | +The localization example in this repository gives users a choice between English (default) and German (localized) versions of two built-in dialogs: |
| 14 | +[Report Viewer](https://docs.devexpress.com/XtraReports/401850/web-reporting/web-document-viewer) and |
| 15 | +[Report Designer](https://docs.devexpress.com/XtraReports/119176/web-reporting/web-end-user-report-designer). |
| 16 | +The example includes projects for both [Delphi](./Delphi) and [C++ Builder](./CPB). |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | +## Prerequisites |
| 21 | + |
| 22 | +- Microsoft Windows 10 or newer |
| 23 | +- Embarcadero RAD Studio IDE 12.3 (Athens) or newer (Community Edition is not supported) |
| 24 | +- The [EdgeView2 SDK](https://getitnow.embarcadero.com/edgeview2-sdk/) package installed from GetIt |
| 25 | +- DevExpress VCL Components v25.2.3 or newer |
| 26 | + |
| 27 | +## Implementation Details |
| 28 | + |
| 29 | +To localize the DevExpress Report Designer and Report Viewer in your Delphi or C++ Builder application, |
| 30 | +do the following: |
| 31 | + |
| 32 | +1. Use the [DevExpress UI Localization Service](https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service) |
| 33 | + to obtain localization files for DevExpress VCL Report Viewer and Designer. |
| 34 | + These files contain UI string translations for a specific language/locale. |
| 35 | + Refer to the following guide for step-by-step instructions: |
| 36 | + [Localize Core Reporting Components: Use JSON Files](https://docs.devexpress.com/XtraReports/400932/web-reporting/common-features/localization/localization-in-asp-net-core-reporting-applications#use-json-files). |
| 37 | +1. Extract downloaded files to a `Localization` folder next to your compiled application executable. |
| 38 | + Note that projects in this repository output their executables to the same location. |
| 39 | + This allows both projects to use the same localization files. |
| 40 | +1. Assign a language identifier (also known as [locale][1] or [culture identifier][2]) to the |
| 41 | + [`TdxReport.Language`](https://docs.devexpress.com/VCL/dxReport.TdxReport.Language) |
| 42 | + property to switch the Report Designer and Report Viewer UI to a specific language: |
| 43 | + |
| 44 | + ```delphi |
| 45 | + dxReport1: TdxReport; |
| 46 | + // Switch Report UI to German |
| 47 | + dxReport1.Language := 'de-DE' |
| 48 | + ``` |
| 49 | +
|
| 50 | +[1]: https://learn.microsoft.com/en-us/globalization/reference/glossary#locale |
| 51 | +[2]: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-globalization-cultureinfo#culture-names-and-identifiers |
| 52 | +
|
| 53 | +For a more detailed step-by-step guide to localizing your applications, refer to the following help topic: |
| 54 | +[Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization). |
| 55 | +
|
| 56 | +This example does not localize report content. |
| 57 | +To localize report content in your project, refer to the following guide: [Report Localization](https://docs.devexpress.com/VCL/405599/ExpressReports/localization/vcl-report-localization). |
| 58 | +
|
| 59 | +The localization mechanism demonstrated in this example applies only to DevExpress Report Designer and Report Viewer components. |
| 60 | +The DevExpress VCL library components support localization using [resource files and the Localizer Editor](https://docs.devexpress.com/VCL/154039/ExpressCrossPlatformLibrary/how-to/localize-an-application). |
| 61 | +
|
| 62 | +## Files to Review |
| 63 | +
|
| 64 | +- [`Delphi/uMainForm.pas`](./Delphi/uMainForm.pas) loads an example report from `ExampleReport.repx`. |
| 65 | + Event handlers assigned to [`TcxRadioButton`](https://docs.devexpress.com/VCL/cxRadioGroup.TcxRadioButton) |
| 66 | + components switch localization language between English and German. |
| 67 | +- [`Localization/*.de.json`](./Localization/) files contain localized UI strings. |
12 | 68 |
|
13 | 69 | ## Documentation |
14 | 70 |
|
15 | | -* [VCL Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization) |
16 | | -* [VCL Reports Localization](https://docs.devexpress.com/VCL/405597/ExpressReports/vcl-reports-localization) |
17 | | -* [DevExpress UI Localization Service](https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service) |
18 | | -* [TdxReport.Language Property](https://docs.devexpress.com/VCL/dxReport.TdxReport.Language) |
| 71 | +- [VCL Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization) |
| 72 | +- [VCL Reports Localization](https://docs.devexpress.com/VCL/405597/ExpressReports/vcl-reports-localization) |
| 73 | +- [DevExpress UI Localization Service](https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service) |
| 74 | +- [TdxReport.Language Property](https://docs.devexpress.com/VCL/dxReport.TdxReport.Language) |
| 75 | +- [ExpressReports Application Deployment Requirements](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports#expressreports-app-deployment) |
| 76 | +
|
| 77 | +## Localized Report Dialogs Preview |
| 78 | +
|
| 79 | +Localized Report Designer: |
| 80 | +
|
| 81 | + |
| 82 | +
|
| 83 | +Localized Report Viewer: |
| 84 | +
|
| 85 | + |
19 | 86 |
|
20 | 87 | <!-- feedback --> |
21 | 88 | ## Does this example address your development requirements/objectives? |
|
0 commit comments