cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve localization in crystal reports 2011

Former Member
0 Kudos

Hi i am using crystal reports 2011.

i have to develop multilingual reports.

i need to change only  headers based on language selected using language parameter.data is same for all languages

if i selected country=india     then labels are

User          Date


vissu          01/05/2012

if country=uk     then

impôt         série


vissu          01/05/2012

Can any one please help me how to implement this.

Hi parik we are manually providing the language.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Vissu,

two ways i can think of for your question.

First-- the dirty solution--

create seperate sections in your report and hide/show them based on your language preference. and also format the sections based on the language selected.

Second-- litle elegant solution--

if you are manually providing the language parameter in your report then

in you java code you can do something like this( remember you will need to change this to java syntax)

--for us english

if( YourLanguage = 'English')

{

     ReportDoc.ReportClientDocument.PreferredViewingLocaleID =

     CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishCanada;

    

     ReportDoc.ReportClientDocument.LocaleID =

     CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishCanada;

    

     ReportDoc.ReportClientDocument.ProductLocaleID =

     CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishCanada;

     CrystalDecisions.ReportAppServer.DataDefModel.CeLocale.ceLocaleEnglishUS;

}

--for canadian french

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;

}

Let me know how it worked for you.

--parik

Former Member
0 Kudos

Hi Parik thank you for your support.

but i need to implement localization dynamically.If tomorrow next language comes we should not edit the source code.Can you please suggest me how to implement this

Former Member
0 Kudos

Vissu,

i think you can expand the code i gave you in the second solution.

what i mean is you can add as many language as offered by crystal reports in your java code and the set the contentLocale accordingly.

so if you want to support say 10 languages, your code will have 10 if else clauses.

Also, i would recommend that you reinstall the crystal reports but select "All Languages'' when prompted for language preference. In this way you will have support for all languages supported by crystal reports.

--parik