Click to See Complete Forum and Search --> : How to handle the localization stuff in Crystal reports XI.


muralimohana_c
December 20th, 2005, 08:58 AM
Hi,
We are using Crystal reports 11 (developer version) in our product. I would like to know, how can we handle the localization stuff in crystal reports other than using the third party tools (like "Crystal Translator" www.softlang.com).

Our application is developed in VC++ (Win32 and MFC ) environment. Here for localization stuff in VC++ is very simple and we can place all strings in .rc, then the translation is required for only the .rc file according to the language.

Is there any similar functionality/feature is there crystal reports 11 to support for the localization stuff ?.

If you guys through some light on this, it will be very helpful to me.

Thanks & Regards,
Murali Mohana Rao Choudari.

sheir
March 23rd, 2010, 03:01 PM
Found a way to for localization of values such as DateTimes in Crystal Reports.
For instance if date is Aug-2009 and culture is French then would display as août-2009.
All this WITHOUT switching the current Thread culture to French.

Relevant Code snippet (example):
//Locale must be set BEFORE report is opened
if (this.IsEnglish)
{
ReportDoc.ReportClientDocument.PreferredViewingLocaleID =
CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishCanada;
ReportDoc.ReportClientDocument.LocaleID =
CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishCanada;
ReportDoc.ReportClientDocument.ProductLocaleID =
CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishCanada;
}
else
{
ReportDoc.ReportClientDocument.PreferredViewingLocaleID =
CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleFrenchCanada;
ReportDoc.ReportClientDocument.LocaleID =
CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleFrenchCanada;
ReportDoc.ReportClientDocument.ProductLocaleID =
CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleFrenchCanada;
}

//Load the report from file path
ReportDoc.Load(reportPath.ToString());