Skip to main content
Solved

Localize devexpress report


Forum|alt.badge.img+2

Hi,

I am using the DevExpress report application provided by thinkwise. I want to localize my report so I can export it in multiple languages. The report is for invoices.

I found this link in the docs: https://docs.devexpress.com/XtraReports/401573/detailed-guide-to-devexpress-reporting/globalize-and-localize-reports/localize-reports

However I cannot find this option in the devexpress provided by ThinkWise. Any suggestions on how to achieve localization?

Best answer by Marc Ferket

Mark Jongeling wrote:

Hi,

I also don't see this available in the TSF DevExpress Report Designer. An alternative way could be to either create a Textbox for every language per field and suppressing those fields based on which language is given via a parameter….”

The solution we use is a variation of the first alternative. We have placed text boxes for each label containing a field from a view. With this view we make sure that we have the language-dependent label texts available.
In this way, the translations are available in multiple reports and are easy to maintain.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

5 replies

Mark Jongeling
Administrator
Forum|alt.badge.img+23

Hi,

I also don't see this available in the TSF DevExpress Report Designer. An alternative way could be to either create a Textbox for every language per field and suppressing those fields based on which language is given via a parameter, or another way is by (almost) completely formatting the Report in your end product in a HTML document, then transferring that in a parameter to the report and showing that. That does mean all translations have to be given in the HTML.

Sounds like a good idea, feel free to create it! I do think more fellow Community members can use this.


Mark Jongeling
Administrator
Forum|alt.badge.img+23

@pvleeuwen I haven't been able to find the Idea yet, feel free to create one as this topic is not suitable to be converted to an Idea. Please create a reply with a link to the idea and mark it as Best answer. Thanks!


Forum|alt.badge.img+7
  • Captain
  • 55 replies
  • Answer
  • January 20, 2022
Mark Jongeling wrote:

Hi,

I also don't see this available in the TSF DevExpress Report Designer. An alternative way could be to either create a Textbox for every language per field and suppressing those fields based on which language is given via a parameter….”

The solution we use is a variation of the first alternative. We have placed text boxes for each label containing a field from a view. With this view we make sure that we have the language-dependent label texts available.
In this way, the translations are available in multiple reports and are easy to maintain.


Forum|alt.badge.img

I found a way to do the translation of labels with the localization option in devexpress. 
In the report in the option pane (screen shot) under design there is an option called Localization.


There you can translate the labels for different languages.

The example report contains a parameter with the selected language that must be used.


This parameter is used in the script section(beforeprint method) to apply the selected language.
(Screen shot)
 

 


Forum|alt.badge.img

Code part:

using System.Globalization;
using DevExpress.XtraReports.UI;

private void Report1_BeforePrint(object sender, System.ComponentModel.CancelEventArgs e) {
    if (Parameters["lang"] != null){   
        ApplyLocalization(Parameters["lang"].Value.ToString());
    }    
}
 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings