|
4 | 4 | [](https://docs.devexpress.com/GeneralInformation/403183) |
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 DevExpress 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) fully supports UI localization. |
| 13 | +The localization example in this repository allows users to select between English (default) and German (localized) versions of two built-in DevExpress 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 | +<img width="450" src="./images/Lokalisierungsbeispiel.png" |
| 19 | +alt="Start screen of the localization example, allowing users to select between English and German, |
| 20 | +and to display Report Designer and Report Viewer dialogs" /> |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +See the [DevExpress Reports Prerequisites]( |
| 25 | +https://docs.devexpress.com/VCL/405773/ExpressCrossPlatformLibrary/vcl-backend/reports-dashboards-app-deployment#vcl-reportsdashboards-prerequisites). |
| 26 | + |
| 27 | +## Implementation Details |
| 28 | + |
| 29 | +To localize the DevExpress Report Designer and Report Viewer in your Delphi or C++Builder application, |
| 30 | +you must: |
| 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 specific languages/locales. |
| 35 | + Refer to the following guide to learn more: |
| 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/Report Viewer to the desired language: |
| 43 | + |
| 44 | + **Delphi:** |
| 45 | + ```delphi |
| 46 | + dxReport1: TdxReport; |
| 47 | + |
| 48 | + // Switch Report UI to German |
| 49 | + dxReport1.Language := 'de-DE' |
| 50 | + ``` |
| 51 | +
|
| 52 | + **C++Builder:** |
| 53 | + ```cpp |
| 54 | + TdxReport *dxReport1; |
| 55 | +
|
| 56 | + // Switch Report UI to German |
| 57 | + dxReport1->Language = "de-DE"; |
| 58 | + ``` |
| 59 | +
|
| 60 | +[1]: https://learn.microsoft.com/en-us/globalization/reference/glossary#locale |
| 61 | +[2]: https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-globalization-cultureinfo#culture-names-and-identifiers |
| 62 | +
|
| 63 | +For a step-by-step guide, refer to the following help topic: |
| 64 | +[Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization). |
| 65 | +
|
| 66 | +This example does not localize report content. |
| 67 | +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). |
| 68 | +
|
| 69 | +The localization mechanism described in this example applies only to the DevExpress Report Designer and Report Viewer. |
| 70 | +Other DevExpress VCL components support localization using [resource files and the Localizer Editor](https://docs.devexpress.com/VCL/154039/ExpressCrossPlatformLibrary/how-to/localize-an-application). |
| 71 | +
|
| 72 | +## Files to Review |
| 73 | +
|
| 74 | +- [`Delphi/uMainForm.pas`](./Delphi/uMainForm.pas) loads an example report from `ExampleReport.repx`. |
| 75 | + Event handlers assigned to [`TcxRadioButton`](https://docs.devexpress.com/VCL/cxRadioGroup.TcxRadioButton) |
| 76 | + components switch localization language between English and German. |
| 77 | +- [`Localization/*.de.json`](./Localization/) files contain localized UI strings. |
12 | 78 |
|
13 | 79 | ## Documentation |
14 | 80 |
|
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) |
| 81 | +- [VCL Report Viewer and Designer UI Localization](https://docs.devexpress.com/VCL/405598/ExpressReports/localization/vcl-report-viewer-and-designer-localization) |
| 82 | +- [VCL Reports Localization](https://docs.devexpress.com/VCL/405597/ExpressReports/vcl-reports-localization) |
| 83 | +- [DevExpress UI Localization Service](https://docs.devexpress.com/GeneralInformation/16235/localization/localization-service) |
| 84 | +- [TdxReport.Language Property](https://docs.devexpress.com/VCL/dxReport.TdxReport.Language) |
| 85 | +- [ExpressReports Application Deployment Requirements](https://docs.devexpress.com/VCL/405469/ExpressReports/vcl-reports#expressreports-app-deployment) |
| 86 | +
|
| 87 | +## Localized Report Dialogs Preview |
| 88 | +
|
| 89 | +**Localized Report Designer:** |
| 90 | +
|
| 91 | + |
| 92 | +
|
| 93 | +**Localized Report Viewer:** |
| 94 | +
|
| 95 | + |
19 | 96 |
|
20 | 97 | <!-- feedback --> |
21 | 98 | ## Does This Example Address Your Development Requirements/Objectives? |
|
0 commit comments