cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports localization issue

Former Member
0 Kudos

Hi,

I am using Crystal Reports for .NET version 2005. Also, I am utilizing SQL Server 2005 as my database server. The problem is when I deploy applications in Spanish countries (maybe others, but did not try yet). The problem happens when dates are passed to SQL Server 2005, but only through Crystal Report engine.

I guess the question is if there is special need to localize crystal report setup?

Thanks in advance

Amer Gerzic

Infinity Software Solutions

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Amer;

What behaviour are you expecting? If you have the report's database fields set to use the System Default values, then the report will change depending on where you are running the report.

Is this a web or windows based application, and what is the verison of Crystal Reports?

Best Regards,

Jonathan

Former Member
0 Kudos

Hi Jonathan,

I am expecting proper behavior (not trying to sound like an a**). I did install Crystal Reports.NET service pack with the file name crvs05sp1.exe downloaded somewhere on support web site. I am not sure what exact version I am running. I can check if you let me know how. As I pointed out, I am running VS2005 on Windows XP and I am using CR version that comes with VS2005. This is a windows application and not web application.

As for the problem. I suspect that date variable is not passed properly to CLR Stored Procedure on SQL Server 2005 Express. In other words, Chile's date format is DD/MM/YYYY while US is MM/DD/YYYY. Considering the fact that the date is most likely passed as an integer and converted back and forth, the parameter passing is mapped in an unpredictable manner. In other words, when I set the parameter programmatically in my program, CR uses US standard to convert it to an integer and passes that integer to CLR Stored procedure, which in turn expects localized date ... and that is the problem.

Thanks in advance!

Amer

former_member208657
Active Contributor
0 Kudos

Crystal Reports allows you to assign any object as the value of a DiscreteParameterValue or RangedParameterValue. What are you actually setting for the Value property? I normally pass a Date or DateTime object instead of a string to avoid this confusion. Please supply code.

Answers (1)

Answers (1)

Former Member
0 Kudos

David,

Thanks a lot for reply!

Here is the code that I use:


                    MachineProductionReport report = new MachineProductionReport();
                    SetReportLogOnInfo(report);

                    ParameterDiscreteValue discreteValue1 = new ParameterDiscreteValue();
                    discreteValue1.Value = dlg.MachineID; <- this has type String
                    report.ParameterFields["@machine_id"].CurrentValues.Add(discreteValue1);
                    report.DataDefinition.ParameterFields["@machine_id"].ApplyCurrentValues(report.ParameterFields["@machine_id"].CurrentValues);

                    ParameterDiscreteValue discreteValue2 = new ParameterDiscreteValue();
                    discreteValue2.Value = dlg.StartDate; <- this has type DateTime
                    report.ParameterFields["@start_date"].CurrentValues.Add(discreteValue2);
                    report.DataDefinition.ParameterFields["@start_date"].ApplyCurrentValues(report.ParameterFields["@start_date"].CurrentValues);

                    ParameterDiscreteValue discreteValue3 = new ParameterDiscreteValue();
                    discreteValue3.Value = dlg.EndDate; // <- this has type DateTime
                    report.ParameterFields["@end_date"].CurrentValues.Add(discreteValue3);
                    report.DataDefinition.ParameterFields["@end_date"].ApplyCurrentValues(report.ParameterFields["@end_date"].CurrentValues);

                    MainReportViewer.ReportSource = report;

The issue is that it works fine in US, but not in Chile ... Everything else works though (passing string, int, etc.)

Thanks in advance!

Amer

former_member208657
Active Contributor
0 Kudos

I think you should look to the SQL query that is executed on the server. I tested this by switching my OS' regional settings and found that the CR .NET report engine correctly identified the DateTime parameter value for English-US and Spanish-Chile. My thought is that the query going to your DB is not done correctly.

Use your db tools to capture the query and see what is going on. You'll also want to test with the Crystal Reports designer on the Chile system to see if you get the same results.

former_member208657
Active Contributor
0 Kudos

One other thing. You'll want to make sure you actually have the language resource files installed on your server. Look in the C:Program FilesBusiness ObjectsCommon4.0managed directory. You'll need to check and see if you have the es folder. If not that means you don't have Spanish files installed.

Look at note 1196781 for details on how to install the language resource files.

https://www.sdn.sap.com/irj/sdn/businessobjects-notes