Skip to Content
0

Fixedly define language for "Enter Parameter Values"-Dialog

Apr 25, 2017 at 07:25 AM

42

avatar image
Former Member

Hi there,

In our C#.Net application we use Crystal Reports for Visual Studio 13.0.19 and we use the "Enter Parameter Values"-Dialog (ParameterPromptControl).

Our problem is that on some client-PCs this parameter-prompt-dialog displays english texts such as:

- dialog-title: "Enter Parameter Values"

- buttons "OK" and "Cancel"

- month-names in a date-chooser (e.g. February, March...)

...and on some client-PCs this parameter-prompt-dialog displays german texts such as

- dialog-title: "Werte eingeben"

- buttons "OK" and "Abbrechen"

- month-names in a date-chooser (e.g. Februar, März)

probably there are other texts as well.

We only want to show all of these texts in German no matter on which client-PC the application runs. Is it possible to define the language for this parameter-prompt-dialog fixedly so that the texts will be displayed always in German?

I'm looking forward to your response.

Andy

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Don Williams
Apr 25, 2017 at 10:36 PM
0

Hi Andreas,

A couple of things to do. And must be set before opening the report each time.

Here's code to get the list of support languages into a drop down list box:

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);
}
}

Then to set the Viewer to use the same you need this:

// this gets the locale when set before the report was opened and sets the viewer to the same language
if (chkSameAsCELocale.Checked)
{
int x = (int)rpt.ReportClientDocument.LocaleID;
crystalReportViewer1.SetProductLocale(x);
}

Note: this only affects static text, values must be in German or depending on data source it can be converted by the client.

Formula text is English only.

I have not tested it using the ParameterPromptControl but if I get time I will.... It should though because there are language dll's for each also.

Don

Share
10 |10000 characters needed characters left characters exceeded