Opening or running an encoded JSP-based Web report Embedding a character set in a JSP file dynamically

2-8 Oracle Reports Users Guide to Building Reports can you edit the HTML or XML code that encapsulates the report block, but you can also edit the report block in the JSP itself, by modifying, adding or deleting their bodies and attributes. The Report Editors Web Source view displays the source code for your Web report, including HTML, XML, and JSP tags. By default, a new JSP created in Oracle Reports Builder contains the following: page contentType=texthtml;charset=ISO-8859-1 If you are creating your JSP outside Oracle Reports Builder, you should ensure that it contains similar encoding information. In prior releases, Oracle Reports introduced Web links that you can add to paper-based reports, which become active when you display your paper report in a Web browser or PDF viewer. For JSP reports, hyperlinks have to be created manually, and if the hyperlinks need to substitute data values, the data values must be provided through the rw:field JSP tag. For example: a href=http:hostname:portpathrwservlet?report=department.jspp_ deptno=rw:field id=F_Deptno src=Deptno rw:field id=F_Deptno src=Deptno10rw:field a

2.2.1.2 Opening or running an encoded JSP-based Web report

If your JSP-based Web reports character encoding for example, EUC-JP differs from the character set portion of the NLS_LANG environment variable for example, JA16SJIS, you will get the following errors: ■ When running the JSP file: REP-6106 or REP-6104 with javax.servlet.jsp.JspException multibyte REP-0495 Unable to tokenize the query singlebyte ■ When opening the JSP file using Oracle Reports Builder: REP-0069 Internal Error or REP-6106 To work around this issue, you must ensure that your JSP-based Web reports character encoding matches the IANA encoding corresponding to Oracle Reports Builders character set portion of the NLS_LANG environment variable. For example: ■ JSP-based Web report encoding: page contentType=texthtml;charset=EUC-JP META http-equiv=Content-Type content=texthtml;charset=EUC-JP This JSP file needs to be encoded in the character set EUC-JP. ■ Oracle Reports Builder encoding: NLS_LANG=JAPANESE_JAPAN.JA16EUC In this example, the JSP-based Web reports encoding EUC-JP matches Oracle Reports Builders character set portion of NLS_LANG; that is, JA16EUC. Advanced Concepts 2-9

2.2.1.3 Embedding a character set in a JSP file dynamically

In Oracle Reports, Web report templates are configured for Western European character encoding by default. However, for other languages, you can specify the character encoding for every 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. Edit the rw.html files and the blank_template.jsp file, as follows:

■ Modify the page directive to read: page contentType=texthtml;charset=yourIANAencoding where: yourIANAencoding is the IANA encoding name that corresponds to the NLS_CHARACTERSET portion of the NLS_LANG variable. ■ Modify the Meta tag inside the Head tag to read: meta http-equiv=Content-Type content=texthtml;charset=yourIANAencoding

2. Edit the template.xsl ORACLE_HOMEreportstemplates file, as

follows: ■ Modify the xsl:output tag to read: xsl:output method=jsp indent=yes encoding=yourIANAencoding where: yourIANAencoding is the IANA encoding name that corresponds to the NLS_CHARACTERSET portion of the NLS_LANG variable. ■ Add the page directive to the file: page contentType=texthtml;charset=yourIANAencoding ■ Add or modify the META tag inside the tag: meta http-equiv=Content-Type content=texthtml;charset=yourIANAencoding where: yourIANAencoding is the IANA encoding name that corresponds to the NLS_CHARACTERSET portion of the NLS_LANG variable. See also Topics Oracle Reports JSP tags and Oracle Reports XML tags in the Reference section of the Oracle Reports online Help 2-10 Oracle Reports Users Guide to Building Reports

2.2.2 About previewing JSP-based Web reports