cancel
Showing results for 
Search instead for 
Did you mean: 

WPF ReportViewer - change language

Former Member
0 Kudos

Hello Community, Don, Ludek and Bhushan!

From my last discussion http://scn.sap.com/message/14970847 I learned the following considering the localization of report documents.

1.) Before the report is loaded into the viewer, the LocaleID must be set. This is done by calling "report.ReportClientDocument.LocaleID". There is the enumeration "CeLocale" in CrystalDecisions.ReportAppServer.CommonControls. Take one of the values out of this enumeration for your localization.

2) There is an UFL which could be installed and registered. C++: http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_b...

C#: http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_b...

Now there is one point missing. To describe the setup of my dev machine:

Operating system: "Windows 7 EN"

Regional settings: "Austria"

If I start my application with "English" as language, the text fields in the report are replaced with the english resources. However, the report viewer is still displayed with german tooltips and menus.

Is there a way to change the language of the ReportViewer control within my source code?

Here you see the screenshot of the report viewer. The application is running with the language set to "english" but the menu still shows the german resources like "Bericht exportieren" or "Vorschau".

Thank you for your support.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Alexander,

There is a great tool call the Object Browse in Visual Studio. Ever tried using it?

Another option is if you simply type in your view report routine:

crystalReportViewer1. and Intelli-sense pops up with the values availalbe and hey... how about that


New info, to set the viewer the same as use this, it will select the same language as selected before opening the report:

x = (int)rpt.ReportClientDocument.LocaleID;

crystalReportViewer1.SetProductLocale(x);

Then you look up LCID in MSDN:

2.2 LCID Structure

And you get the locale ID num's or Strings to add.

How you handle that part is up to you....

Thanks again

Don

PS - sorry for sounding sarcastic but seems a lot of Developers lately are not even looking into what is available, it's just easier to post here...

I'll also add this one line of code to the kbase I wrote with the info from the other post.

2003581 - How to set the Localization for a Crystal Reports .NET application

Former Member
0 Kudos

Hello Don!

Nice to hear from you again.

Yes, I know what the Object Broswer is. The sad thing is that the SetProductLocale Method is included in the Windows Forms assembly.

As I have stated in the Thread title I need it for the WPF control.

So I have to call

crCrystalReportViewer.ViewerCore.ProductLocale = new CultureInfo(twoLetterLanguageCode);

Thank you for the tip and the kind help. Yes, russion is supported by the viewer control although i have the next issue .

Alex


To your PS: I fully understand your critics and why I have upset you. Please forward the next points to the responsible persons.

  • Documentation is not up to date. As you have stated in the earlier thread there are differences between the API and the documentation. So what should I do now? Using something that I do not know what it does trying to get something up and running? Maybe using an undocumentated features which is not available in the next release?
  • No link to documentation. If I look into the installation folder "C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011\HelpFiles" I see that ther are Cab files which should contain help documents. But I have no link to any of the documents so that I could open them.
    How could I search something that I can not even access? Getting over all available classes in the document browser is a very time consuming task. Time that I am not having .
  • In my personal opinion, the windows forms controll is still preferred over the WPF control although windows forms is only in "Maintenance" via Microsoft. Reading the posts form my last threads "WPF? Dont know if this functions" is something like a default statement from the helpful supporters.
  • There is documentation for the localization. What I am missing is a full example how to localize everything beginning from the report document to the viewer.
0 Kudos

Hi Alexander,

Understandable.... Our help files are kept up to date at this location:

http://help.sap.com/analytics

Makes it easier to keep them updated there than ship them and then figure out a way to update the local copies. It's the way of documentation now, since everyone has access to the WEB why not put then up there than have local copies....

As you know there are so many different ways of doing things in .NET, not just CR runtime.... But especially true for CR runtime, which one to use and when is complicated and I've seen code sampels from users and developers that accomplish the same thing but in completely different process...

So totally understandable, I forget sometimes that I've looked at our API's for 17 years now and not everyone has my history.... CR API's can be overwelming at times... A lot easier when we just had WIN32 and crpe32 to program in....

Thanks again and have a great day

Don

Former Member
0 Kudos

Hello Don!

Thank you for the helpful link.

I have added it to my bookmark list.


Answers (0)