I have a requirement that I need to display a column in spanish and all the other columns in English. So from a date (13-FEB-2012), I need to pull out month and name of the month in Spanish February as (febrero).
I thought to do as below in Oracle but how can I acheive this in Crystal Reports 2008 .
Are you using tables/views in your report or are you using a command?
If you’re using tables or views, you can create a SQL Expression that is similar to the Oracle command that you show in your post. If you’re using a command, add this to the command. If you’re using a stored procedure, you’ll have to modify the stored procedure to include this column.
Another option is to translate it in a formula, somthing like this:
NumberVar YearNum := year({EventDate});
NumberVar MonthNum := month({EventDate});
NumberVar DayNum := day({EventDate});
StringVar result := ToText(DayNum, 0) + '-';
result := result +
Switch(MonthNum, 1, <Spanish for Jan>,
MonthNum, 2, <Spanish for Feb>,
MonthNum, 3, <Spanish for Mar>,
...
MonthNum, 12, <Spanish for Dec>) + '-' + ToText(YearNum);
result
Note that the example doesn’t do any null handling - if the field can be null, you’ll have to add that as well.
Thanks for your clear reply. I wanted to bring data from Stored procedure and I don’t want to change in the procedure , I wanted to do it in Crystal report level and did as below. Just wondering what if this is not months and some data,Is there a way we can do this in report level to change a column data into Spanish or any supported languages ? I don’t need this at the moment but just asking out of curiosity. Thanks