This chapter discusses how to work with multiple languages.
This section discusses:
Data returned by the report.
Report layout and boilerplate text.
Crystal Reports Designer/Runtime language versions.
Language parameter for pscrrun.exe.
Configuration of Crystal Reports for multilingual environments.
Translated report searches.
Data that is returned by Crystal Reports 9 is fetched from the database using PeopleSoft Query; data that is returned by BusinessObjects Enterprise XI is fetched from the database using Query Access Services (QAS). Therefore, the data is already language-sensitive due to the automatic joining to related language tables that PeopleSoft Query performs. No special logic is required to ensure that appropriate descriptions from related language tables are returned in Crystal Reports output.
See Getting Started with PeopleSoft Query.
See The Enterprise PeopleTools 8.49 Installation guide for your database platform, Installing and Configuring Software for Crystal Reports, Install BusinessObjects Enterprise XI, Understanding QAS.
The Crystal Reports .rpt file contains the layout of the report and any text that is hard-coded into the layout, such as column headings, headers, and footers. Because Crystal Reports does not provide any ability to maintain multiple translations of this boilerplate text in a single .rpt file, you must maintain a separate copy of the report layout for each language.
For use with the Crystal Reports 9 runtime environment, PeopleSoft PeopleTools maintains separate directories on the file and report servers within the <PS_HOME>\CRW directory that correspond to the language codes that are available for your PeopleSoft implementation. Each directory contains the appropriate report in the specified language if the report has been translated. PeopleSoft PeopleTools reads the report from the directory that corresponds to the user’s preferred language. If it cannot find the report there, Crystal Reports 9 uses the report in the base language directory <PS_HOME>\CRW. Finally, if the report is not in the directory corresponding to the user’s current language or in the base directory, PeopleSoft PeopleTools uses the copy of the report in the <PS_HOME>\CRW\ENG directory.
For use with the BusinessObjects XI runtime environment, PeopleSoft PeopleTools maintains separate language subdirectories in the BusinessObjects Enterprise report repository.
Crystal Reports is available in several different language editions. You receive the appropriate language edition of Crystal Reports based on the languages that you license when you purchase Oracle's PeopleSoft Enterprise software. Each language version of Crystal Reports is functionally identical; the primary difference is the language of the Crystal Reports Designer user interface. You do not need to match the language of the Crystal Reports design or runtime engine to the language of the report that you are creating unless you are using the Crystal ToWords function. You can overcome this limitation by using the PSToWords or PSToWordsLoc functions.
Using PSToWords and PSToWordsLoc
PSToWords and PSToWordsLoc are similar to the Crystal ToWords function in that they convert a numerical amount into a textual representation of that amount, as you see on checks. But unlike ToWords, these functions are independent of the installed language of Crystal Reports Designer. After you configure the location of the supporting .dlls, these functions appear in the Crystal Function Editor as new Additional Functions.
Configuring Crystal Reports Designer to Use PSToWords
PSToWords and PSToWordsLoc functionality is contained in three files called psicuuc22.dll, psicudt22l.dll, and psicuin22.dll. These files are located in your <PS_HOME>\bin\client\winx86 directory. To use these functions in Crystal Reports Designer, you must either add the location of these .dll files to your PATH environment variable so that Crystal Reports can find and load them or—for Crystal Reports 9—copy them to your local directory where crw32.exe is installed (C:\Program Files\BusinessObjects\Crystal Reports 9). For Crystal Reports XI, you don't have to copy the files because the installation program automatically does this for you. For Process Scheduler to use these functions in a scheduled report, you do not need to configure anything because <PS_HOME>\bin\client\winx86 is the current directory for the Process Scheduler.
You can type PSToWords or PSToWordsLoc directly in the Function Editor, or you can choose these functions from the list of Additional Functions in the Function Editor of the Crystal Reports 9 Designer. To confirm that the .dlls are loaded in Crystal Designer, select Help, About, More Info, and check that the three psicu files are listed.
Syntax for PSToWords and PSToWordsLoc
The syntax for PSToWords is PSToWords(number,places), where number is a numeric amount and places is the number of decimal places or precision to print. For instance, PSToWords(12.345,2) prints twelve and 35 / 100.
The syntax for PSToWordsLoc is PSToWordsLoc(locale,number,places), where the locale parameter specifies an International Organization for Standardization (ISO) language or locale code. For instance, PSToWordsLoc("es",12.345,2) prints doce y 35 / 100. For examples of ISO locales that are used in PeopleSoft Enterprise products, see the following cross-references.
See Determining PeopleSoft and ISO Codes for Your Language.
See Using Browser Language Settings to Determine the Sign-in Language.
Converting Entities to Characters
Crystal Reports is Unicode-enabled, except in Application Protocol Interface (API) function calls. To work around this limitation, PSToWords and PSToWordsLoc return any non-USASCII characters as HTML decimal entities. To convert these entities to Unicode characters, you need to include a report custom function in your .rpt file. In Crystal Reports Designer Formula Workshop, create a new Report Custom Function called PSToUChar and paste in the following code:
Function (StringVar instring) local StringVar outstring := ""; local NumberVar i; local StringVar curtoken; local NumberVar toklen; local StringVar widechar; //Convert Entities to ChrW for i := 1 to (Length(instring)) Do ( curtoken := mid(instring,i,2); toklen := instr(i+2,instring,";")-(i+2); if curtoken = "&#" then widechar := chrw(val(mid(instring,i+2,toklen))); if curtoken = "&#" then outstring := outstring + widechar; if curtoken = "&#" then i:=i+toklen+2; if curtoken <> "&#" then outstring := outstring + mid(instring,i,1); ); outstring;
A report-defined function enables you to define a function to be saved within the .rpt file. The syntax for this function is
PSToUChar(PSToWords(number,places))
or
PSToUChar(PSToWordsLoc(locale,number,places))
The largest number converted to words is 999,999,999.999 for most languages. Numbers higher than that amount, or where the encoded string of words would exceed 254 bytes, appear as digits rather than as words.
Because Thai words for numbers often exceed the 254-byte limit when encoded as entities, you can use the special locale x-th instead of th to return the Thai characters without encoding them as entities. Using the special locale allows a longer string to be processed, but requires a server with a system default locale set to Thai. The syntax for Thai processed in this way is: ToWordsLoc("x-th",number,places).
PeopleSoft Process Scheduler uses the pscrrun.exe process to run Crystal Reports 9. The process’s language code parameter specifies the language directory that pscrrun.exe uses to fully qualify the report path. Unlike Structured Query Reports (SQRs), pscrrun.exe searches for a separate Crystal Reports file for each translation of the report. The language directory parameters are needed because each language-specific report is stored in a separate language directory. If the report is not found in the language that is specified by the parameter, pscrrun.exe looks in the default, base-language directory.
Typically, the language parameter is passed to pscrrun.exe from the run control that is associated with your Crystal report.
Note. The executable program for Crystal Reports 9 is PSCRRUN.EXE. The executable program for BusinessObjects Enterprise XI is PSBOERUN.EXE.
The command line executable changes when you convert your reports to the Crystal XI format.
See The Enterprise PeopleTools 8.49 Installation guide for your database platform, Installing and Configuring Software for Crystal
Reports, Converting Crystal Reports, Converting Reports from Crystal Reports 9 format to Crystal Reports XI format.
See Also
Enterprise PeopleTools 8.49 PeopleBook: PeopleSoft Process Scheduler
The PeopleSoft system allows you to use a single Crystal Reports server for all languages. The following features support this functionality:
Unicode support
Crystal Reports for PeopleSoft products support Unicode.
Locale formatting
Locale formatting is based on the user personalizations of the user who is scheduling the report, not the formatting set on the report server. If you do not want locale formatting to be based on the user personalizations of the user who is scheduling the report—for example, if the user wants to preserve the date or time formatting that is hard-coded in the report file—then use the -LX0 parameter to disable locale processing.
ToWords functionality
The ToWords function (used in printing checks) is supplemented by PSToWords, which can support any PeopleSoft-supported language instead of just the language of the installed version of Crystal Reports.
See Crystal Reports Designer/Runtime Language Versions.
To call up translated production reports in the correct language, the Crystal Reports for PeopleSoft application performs the following steps in this order:
The -RP parameter specifies a path and report name, including the .rpt extension.
If the report exists, the Crystal Reports for PeopleSoft application selects the report. If the report does not exist, the search for the report fails.
The -RP parameter specifies a path but does not specify the full report name, including the .rpt extension.
Crystal Reports looks for translated reports based on the path in the -RP parameter as follows:
The Crystal Reports for PeopleSoft application appends the language code, as defined by the -LG parameter of the command line, to the path that is set in the -RP parameter and searches for the report.
If the report does not exist, the application appends the language code that uses the preferred language as specified on the user’s machine to the path that is set in the -RP parameter and searches for the report.
If the report still does not exist, the application appends the language code that uses the base language as defined for the PeopleSoft system to the path that is set in the -RP parameter and searches for the report.
If the report still does not exist, the application searches for the report using the path that is set in the -RP parameter.
If the report is not found in any of these directories, the search fails.
The -RP parameter is not specified.
Crystal Reports 9 looks for translated reports based on the CRWRPTPATH environment variable as follows:
The Crystal Reports for PeopleSoft application appends the language code, as defined by the -LG parameter of the command line, to the path that is set in the directory that is specified by the CRWRPTPATH environment variable and searches for the report.
If the report does not exist, the application appends the language code that is the preferred language as specified on the user’s machine to the path that is set in the directory specified by CRWRPTPATH and searches for the report.
If the report still does not exist, the application appends the language code that is the base language as defined for the PeopleSoft system to the path that is set in the directory that is specified by CRWRPTPATH and searches for the report.
If the report still does not exist, the application searches for the report using the path that is set in the directory that is specified by CRWRPTPATH.
If the report is not found in any of these directories, the search fails.
BusinessObjects Enterprise XI searches for translated reports in the BusinessObjects Enterprise report repository in the same way.
See Defining PeopleSoft Process Scheduler Support Information, Specifying the Path for Production of Crystal Reports.