on 12-17-2012 5:58 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.