Writing XML to a File for Debugging

23-2 Publishing Reports to the Web with Oracle Reports Services

23.1.1 Language-Independent Functions

Language-independent functions handle manipulation of data in an appropriate manner, depending on the language and territory of the runtime operator. Data is automatically formatted according to local date and time conventions.

23.1.2 Language-Dependent Data

With language-dependent data, you can isolate your data. This enables your application to deal only with translating strings that are unique to your application. Because the language-dependent data is separate from the code, the operation of globalization support functions is governed by the data supplied at runtime. New languages can be added and language-specific application characteristics can be altered without requiring code changes. This architecture also enables language-dependent features to be specified for each session.

23.2 Globalization Support Environment Variables

Globalization support environment variables are automatically set to default values during Oracle Fusion Middleware installation. Table 23–1 lists and describes globalization support-related environment variables that are relevant to Oracle Reports Services.

23.2.1 NLS_LANG Environment Variable

The NLS_LANG environment variable specifies the language, territory, and character set settings to be used by Oracle Reports Services. Specifically: ■ The language for messages displayed to the user ■ The default format masks used for DATE and NUMBER data types ■ The sorting sequence Note: With the environment switching feature, you are not limited to the default environment set at the time of installation, and you can configure multiple environments, including language settings, for a single Reports Server. For more information, refer to Section 8.2.2, Dynamic Environment Switching . Table 23–1 Oracle Reports ServicesEnvironment Variables for Globalization Support Variable Description NLS_LANG Relevant to Oracle Reports Services. The language settings used by Oracle Reports Services. See Section 23.2.1, NLS_LANG Environment Variable . DEVELOPER_NLS_LANG The language for Oracle Reports Builder. If not set, then NLS_LANG default values are used. See Section 23.2.2, DEVELOPER_NLS_LANG and USER_NLS_LANG Environment Variables . USER_NLS_LANG The language for Reports Runtime. If not set, then NLS_LANG default values are used. See Section 23.2.2, DEVELOPER_NLS_LANG and USER_NLS_LANG Environment Variables . Implementing Globalization and Bidirectional Support 23-3 ■ The character set The syntax for NLS_LANG is: NLS_LANG=language_territory.charset The values are defined as follows: ■ language Specifies the language and its conventions for displaying messages including error messages as well as day and month names. If language is not specified, then the value defaults to American. See Section 23.2.1.2, Defining the Language and Territory . ■ territory Specifies the territory and its conventions for default date format, decimal character used for numbers, currency symbol, and calculation of week and day numbers. If territory is not specified, then the value defaults to America. See Section 23.2.1.2, Defining the Language and Territory . ■ charset Specifies the character set in which data is displayed. This should be a character set that matches your language and platform. This option also specifies the character set used for displaying messages. See Section 23.2.1.3, Defining the Character Set . Your NLS_LANG setting should take into account regional differences between countries that use basically the same language. For example, if you want to run in French as used in France, then you set the NLS_LANG environment variable: NLS_LANG=FRENCH_FRANCE.WE8ISO8859P1 If you want to run in French, but this time as used in Switzerland, you would set the NLS_LANG environment variable: NLS_LANG=FRENCH_SWITZERLAND.WE8ISO8859P1 Note: This environment variable is set automatically when you install Oracle Fusion Middleware. Refer to Section 23.2.1.1, Defining the NLS_LANG Environment Variable for more information about changing the environment variable after installing Oracle Fusion Middleware. Note: When you use features like Oracle Portal Security, Portal Destination, and Job Status Repository, the JDBC database connections made by Oracle Reports Services may override the initial NLS_LANG setting. This change may in turn affect the behavior of the running report, such as aliasing PDF output in Asian languages. On UNIX platforms, you can work around this issue by using the environment switching functionality to dynamically set the environment for reports, as described in Section 8.2.2, Dynamic Environment Switching . 23-4 Publishing Reports to the Web with Oracle Reports Services

23.2.1.1 Defining the NLS_LANG Environment Variable

You define the NLS_LANG environment variable in the same way you define other environment variables on your Windows or UNIX operating system.

23.2.1.1.1 Windows To define the NLS_LANG environment variable on Windows, do the

following:

1. Open the Windows registry.

2. Expand the HKEY_LOCAL_MACHINE node, then expand the SOFTWARE node.

3. Expand the Oracle node, then click your Oracle Reports Services HOME node to

display the Oracle environment variables in the right panel of the Registry Editor. 4. Double-click the NLS_LANG environment variable.

5. Type the new value for NLS_LANG in the Value data text box.

6. Click OK.

23.2.1.1.2 UNIX To define the NLS_LANG environment variable on the UNIX platform,

set it in the shell script reports.sh, located in your ORACLE_ INSTANCEconfigreportsbin directory.

23.2.1.2 Defining the Language and Territory

While the character set ensures that the individual characters needed for each language are available, support for national conventions provides correct localized display of data items. The specified language determines the default conventions for the following characteristics: ■ Language for Oracle Reports Services messages and message from the Oracle Database. ■ Language for day and month names and their abbreviations specified in the SQL functions TO_CHAR and TO_DATE. ■ Symbol equivalents for AM, PM, AD, and BC. ■ Default sorting sequence for character data when ORDER BY is specified GROUP BY uses a binary sort unless ORDER BY is specified. ■ Writing direction both right to left and left to right. For example, if the language is set to French, then the following messages in English are converted to French: Note: The language for the rwservlet pages such as showjobs,showenv, online Help, and error messages are delivered from the middle tier machines locale or LANG on UNIX and not NLS_LANG. For example, if you have set your middle tier locale to French and NLS_LANG=JAPANESE_JAPAN.JA16SJIS, the showjobs or error messages will be displayed in French, not in Japanese. Note: Back up your registry before you edit it. Implementing Globalization and Bidirectional Support 23-5 English: ORA-00942: table or view does not exist REP-0110: Unable to open file. French: ORA-00942: table ou vue inexistante REP-0110: Impossible douvrir le fichier The specified territory determines the conventions for the following default date and numeric formatting characteristics: ■ Date format ■ Decimal character and group separator ■ Local currency symbol ■ ISO currency symbol ■ Week start day ■ Credit and debit symbol ■ ISO week flag ■ List separator For example, if the territory is set to France, then the numbers are formatted using a comma as the decimal character.

23.2.1.3 Defining the Character Set

The character set component of the globalization support environment variables specifies the character set in which data is represented in your environment. When data is transferred from a system using one character set to a system using another character set, it is processed and displayed correctly on the second system, even though some characters might be represented by different binary values in the character sets.

23.2.1.3.1 Character Set Design Considerations If you are designing a multilingual

application, or even a single-language application that runs with multiple character sets, you must determine the character set most widely used at runtime and then set the NLS_LANG environment variable to that particular character set. If you design an application in one character set and run it in another character set, performance can suffer. Furthermore, if the runtime character set does not contain all the characters in the design-time character set, then question marks appear in place of the unrecognized characters.

23.2.1.3.2 Font Aliasing Considerations There may be situations where you create a

multilingual application with a specific font but find that a different font is being used when you run that application. You would most likely encounter this when using an English font such as MS Sans Serif or Arial in environments other than Western European. This occurs because Oracle Reports Services checks to see if the character set associated with the font matches the character set specified by the language environment variable. If the two do not match, Oracle Reports Services automatically substitutes the font with another font whose associated character set matches the character set specified by the language environment variable. This automatic substitution assures that the data being returned from the database gets displayed correctly in the application. 23-6 Publishing Reports to the Web with Oracle Reports Services There might be cases, however, where you do not want this substitution to take place. You can avoid this substitution by mapping all desired fonts to the WE8ISO8859P1 character set in the font alias file uifont.ali. For example, if you are unable to use the Arial font in your application, you can add the following line to your font alias file: ARIAL.....=ARIAL.....WE8ISO8859P1 This example specifies that any Arial font should be mapped to the same value, but with the WE8ISO8859P1 character set. For more information about font aliasing and uifont.ali, see Section 11.2.2.1, Font Aliasing .

23.2.2 DEVELOPER_NLS_LANG and USER_NLS_LANG Environment Variables

If you must use two sets of resource and message files at the same time, then two other language environment variables are available. These can be used after Oracle Fusion Middleware installation is completed. ■ DEVELOPER_NLS_LANG ■ USER_NLS_LANG The syntax for DEVELOPER_NLS_LANG and USER_NLS_LANG is the same as for the NLS_LANG environment variable. That is: DEVELOPER_NLS_LANG=language_territory.charset USER_NLS_LANG=language_territory.charset If these environment variables are not specifically set, then NLS_LANG default values will be used. Use the DEVELOPER_NLS_LANG and USER_NLS_LANG environment variables in lieu of the NLS_LANG environment variable in the following situations: ■ You prefer to use Reports Builder in a particular language for example, English, but you are developing an application for another language. DEVELOPER_NLS_ LANG and USER_NLS_LANG environment variables allow you to use different language settings for the Oracle Reports Builder and Reports Runtime. ■ You are creating an application to run in a language for which a local language version of Oracle Reports Builder is not currently available.

23.3 Specifying a Character Set in a JSP or XML File

In Oracle Reports, Web-report templates are configured by default for Western European character encoding. For other languages, you must specify the character encoding for a JSP file by using both the charset attribute of the meta tag and the page page directive. To dynamically associate the appropriate character encoding with the JSP file, you can make the following modifications:

1. In the directory oracle_homereportstemplates, edit the files rw.html

and blank_template.jsp:

a. Modify the page directive to read

Note: If you enter local characters using an English font, then Windows does an implicit association with another font.