on 04-09-2014 9:55 AM
Hello Community!
Concerning the content of the document http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e06b8953-a62b-2d10-38b9-ca71f747e... the russian language is supported.
Do I have to install a language pack on the client or are the language packs included in the current redistributable version of the runtime package?
Thank you for the information!
What version of CR are you using? Perhaps the best way to tell is to check on the version of the assembly CrystalDecisions.CrystalReports.Engine referenced in your application.
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
looks like the KB is not available on SCN yet.
here is the solution from the KB.
How to set localization for a CR.NET app.
Create a Windows List box and label it lstCELocale.
Using this code in the form load you can get/set the locale:
Note: the Locale must be set before loading the report.
public frmMain()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
Array valArray = Enum.GetValues(typeof(CrystalDecisions.ReportAppServer.CommonControls.CeLocale));
foreach (object obj in valArray)
{
lstCeLocale.Items.Add(obj);
}
//
// TODO: Add any constructor code after InitializeComponent call
//
}
You will see the ceLocalization ENUM's listed and can set the selected with this code:
CrystalDecisions.ReportAppServer.CommonControls.CeLocale myceLocale;
private void lstCeLocale_SelectedIndexChanged(object sender, EventArgs e)
{
//this is the routine to set the default language locale for the report. Must be done before the report is loaded.
CrystalDecisions.ReportAppServer.CommonControls.CeLocale myceLocale = (CrystalDecisions.ReportAppServer.CommonControls.CeLocale)lstCeLocale.SelectedItem;
try
{
rpt.ReportClientDocument.LocaleID = (CrystalDecisions.ReportAppServer.DataDefModel.CeLocale)myceLocale;
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
}
}
Thanks,
Bhushan
Hello Bhushan!
Thank you for the code. So this sets the localization ID for the document.
Are the codes from the CeLocale Enum ISO Codes?
How can I set the report viewer language?
Can I set the viewer language during runtime? (My reports are reloaded when I am switching the language.)
BTW: We are using the WPF Viewer, not the Forms Viewer
Thank you for your help
All this info is available in CR.NET Developer guide.
http://help.sap.com/businessobject/product_guides/sapCRVS2010/en/crnet_dg_2010_en.zip
In the guide navigate to
Using the SDK -> Customizing the CrystalReportViewer control -> Supporting multiple languages with the CrystalReportViewer control.
Do check out the tutorial.
Frankly, I have never tried this for WPF viewer. You could give it a shot though.
-Bhushan
Hello Bhushan!
Thank you for the Link.
From the chapter you pointed me, I learned about the UTF and GB18030 support of the report viewer control.
From the section "Tutorial\Other Tutorials\Tutorial: Cinfiguring Multilingual Client Support" I find how I configure my application and I will try that.
What still confuses me is the difference of the supported languages. In the Help file of the SDK, russian is not supported.
In the document "http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e06b8953-a62b-2d10-38b9-ca71f747e..." from the 4. April 2014 russian is listed as supported during runtime.
Is a russian language pack available for the WPF Viewer or do I have to translate the resources on my own?
Thank you
Hi Alexander,
If you had tried the code in the KBA you would see the language is there.
I do not have a Russian report but here's one in German that will not run unless the locale is set to German. As you can see Russian is listed.
Complete code looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CrystalDecisions.ReportAppServer.CommonControls;
namespace CrystalReportWpfApplication3
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
public Window1()
{
InitializeComponent();
Array valArray = Enum.GetValues(typeof(CrystalDecisions.ReportAppServer.CommonControls.CeLocale));
foreach (object obj in valArray)
{
listBox1.Items.Add(obj);
}
}
private void reportViewer_Loaded(object sender, RoutedEventArgs e)
{
}
private void button1_Click(object sender, RoutedEventArgs e)
{
reportViewer.Owner = this;
doc.Load(@"D:\Test.rpt");
reportViewer.ViewerCore.Visibility = Visibility.Visible;
reportViewer.ViewerCore.ReportSource = doc;
}
private void listBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
//this is the routine to set the default language locale for the report. Must be done before the report is loaded.
CrystalDecisions.ReportAppServer.CommonControls.CeLocale myceLocale = (CrystalDecisions.ReportAppServer.CommonControls.CeLocale)listBox1.SelectedItem;
try
{
doc.ReportClientDocument.LocaleID = (CrystalDecisions.ReportAppServer.DataDefModel.CeLocale)myceLocale;
}
catch (Exception ex)
{
MessageBox.Show("ERROR: " + ex.Message);
}
}
}
}
Thanks again
Don
Thank you for the information and yes it seems to work.
But I want to show translated texts in the report viewer only. Why? My reports have been designed to be language neutral (expect for the automatic texts like "page X of Y"). If I change the language, I reload my report, open it an iterate over all textfields in my C# code.
If I find the name of a textfield in my resource file, I replace the caption of the label/textfield and open the translated report in the report viewer.
I tried setting the ceLocale as in your example.
I configured my application to show all texts in english.
Before the report is opened, the localeId is set to "German" (currently fixed).
My App "English" + Report "German" -> Report is not shown although the Viewer displayes everything in German.
My App "German" + Report "German" -> Report is shown which is OK.
I still do not understand why the report is not shown if I set the ceLocale to a differnt language.
Example:
I am placed in Austria. The local settings (currency, date and time) of my operating system are set to Austria.
The language of my operating system is english.
I set the language of my application to english.
I fill my report with english captions. But the report viewer shows all texts in german. How can I tell the report viewer that it should display it's tooltips and button texts now in english?
We will have installations with englisch operating system, local set to Turkey and the application is used with the german texts. Which language will the viewer choose?
How can i translate the ISO two letters to you ceLocale enum? Is there a way in which the two correspond?
Thank you for your help so far
Hello Don, Ludek and Bhushan
Thank you for pointing me to the UFL, but I am already translating the static text field that I have placed on the report.
A part of my solution you can find at http://scn.sap.com/thread/1615632 where Ludek helped me.
1 Report Viewer
I need to tell the ReportViewer control that my program is now using German or English or Russian. I don't want to be dependent on the regional settings of my operating system as stated in the "SAP Crystal Reports .NET SDK Developer Guide" in chapter "Tutorials\Other tutorials\Tutorial: Configuring Mulitlingual Client Support\Configuring multilingual client support for a Windows application".
I want to tell the ReportViewer - not my Report document - which language should be displayed and it would be great if you can give me a hint to such a function.
Attached please see the picture where my application is displaying all texts in english expect the report viewer Control which still shows the German tooltips.
2 Documentation discrepancy
I am still missing an answer for:
"What still confuses me is the difference of the supported languages. In the Help file of the SDK, russian is not supported.
In the document "http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e06b8953-a62b-2d10-38b9-ca71f747e..." from the 4. April 2014 russian is listed as supported during runtime. "
Which document is correct? Does it mean that the language is supported by
- yes, texts from this language could be displayed or
- yes, the ressources for this language are included?
3 Needed Files for translation
I downloaded the example with the localization (LanguageResourceFiles.zip) there are all the folders with the current translation. I am missing the english folder as i need the english original for the translation process.
Where can I find them?
4 Translation of files
In the example with the localization multiple files are found. I assume that I need to translate the following files for a windows desktop application:
CREngine.txt
CRVSShell.txt
SCRShared.txt
SCRViewerReportSource.txt
Viewer.txt
The files CRWebFormViewer.txt and WebServices.txt" are not needed for the desktop application.
Am I right?
Thank you for you help
Message was edited by: Alexander Frühwirth Changes: Greeting added point 4
1. The report engine and locale must be set for the app before opening the report as my sample shows, you can't set just the viewer because the Engine also has to render the report with the specified language..
2.Help file can be delayed in updates. Use my code snippet I first posted, if the ENUM for the language is there it's supported.
3. English is the default language if there is no language dll. There is no separate Language dll package for CR for VS, all of the language dll's are located in the \win32_x86 folder and x64 folder.
Don not use any other language package for htis product.
4. Not sure what you are referring to?
Don
Hello Don!
Thank you for your reply again.
1) I am setting the LocaleID of the report before the report is added to the reportViewer.ViewerCore.Report Source. The text snippets - e.g. {Page X of Y} - which I am using within my report is set acording to the used LocaleID. The report document is fine but the ReportViewer is not.
2.) Thank you for clarifing this.
As russian is in the enum, I dont have to make any translation for the ReportViewer resources?
ad 2) "Help file can be delayed in updates" sounds nice, the SDK Dev Guide is from 2012 Considering the information in the chapter "Reference: Configuring an environment locale" you can find details how to do this for Windows XP and Windows 2000.
What about Windows Vista and Windows 7?
Thank you very much for your help
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.