Skip Headers
Oracle® Fusion Middleware Oracle Reports User's Guide to Building Reports
11g Release 1 (11.1.1)

Part Number B32122-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

2.2 Web Reports

The topics in this section build on the basic concepts discussed in Section 1.2.2, "About Web Reports".

See also

Section 1.2.2, "About Web Reports"

2.2.1 About JavaServer Pages (JSPs) and servlets

JavaServer Pages (JSPs) technology is an extension to the Java servlet technology from Sun Microsystems that provides a simple programming vehicle for displaying dynamic content on a Web page. A JSP is an HTML page with embedded Java source code that is executed in the Web server or application server. The HTML provides the page layout that is returned to the Web browser, and Java provides the business logic.

JSPs keep static page presentation and dynamic content generation separate. Because JSPs cleanly separate dynamic application logic from static HTML content, Web page designers who have limited or no Java programming expertise can modify the appearance of the JSP page without affecting the generation of its content, simply using HTML or XML tags to design and format the dynamically-generated Web page. JSP-specific tags or Java-based scriptlets can be utilized to call other components that generate the dynamic content on the page.

JSPs have the .jsp extension. This extension notifies the Web server that the page should be processed by a JSP container. The JSP container interprets the JSP tags and scriptlets, compiles the JSP into a Java servlet and executes it, which generates the content required, and sends the results back to the browser as an HTML or XML page.

A JSP can be accessed and run from a browser-based client, typically over the Internet or a corporate intranet. Unlike traditional client-server applications, JSP applications:

  • run on a wider variety of client machines and browsers.

  • run on thinner clients, thereby consuming fewer client-machine resources.

  • scale to a larger number of simultaneous users.

  • require less effort to install and maintain.

When a JSP is called for the first time, it is compiled into a Java servlet class and stored in the Web server's memory. Because it is stored in memory, subsequent calls to that page are very fast, thereby avoiding the performance limitations seen with traditional Common Gateway Interface (CGI) programs, which spawn a new process for each HTTP request.

For additional background information about JSP technology, see the Sun Microsystems Java and Java EE Web site at http://java.sun.com.

2.2.1.1 Using JSPs in Oracle Reports

Oracle Reports supports JavaServer Pages (JSPs) as the underlying technology to enable you to enhance Web pages with information retrieved using Oracle Reports Builder.

In Oracle Reports, you use JSPs to embed data retrieved using the data model into an existing Web page to create a JSP-based Web report. You can create new JSP reports, or save existing reports as JSP reports. New reports are by default saved as JSP reports. The benefit of saving reports as JSPs is that JSPs are text files that are easy to edit as opposed to, for example, the binary .rdf format. When a report is saved as a JSP file, the data model is embedded using XML tags. The entire report can now be defined using XML tags and saved as an XML file.

Using the Oracle Reports custom JSP tags, you can easily add report blocks and graphs to existing JSP files. These tags can be used as templates to enable you to build and insert your own data-driven Java component into a JSP-based Web report. Not only 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 Editor's 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="text/html;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:port/path/rwservlet?report=department.jsp&p_deptno=<rw:field

  id="F_Deptno" src="Deptno"/>"> 
<rw:field id="F_Deptno" src="Deptno">10</rw:field> 
</a> 

2.2.1.2 Opening or running an encoded JSP-based Web report

If your JSP-based Web report's 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 report's character encoding matches the IANA encoding corresponding to Oracle Reports Builder's character set portion of the NLS_LANG environment variable.

For example:

  • JSP-based Web report encoding:

    <%@ page contentType="text/html;charset=EUC-JP" %>
    <META http-equiv="Content-Type" content="text/html;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 report's encoding (EUC-JP) matches Oracle Reports Builder's character set portion of NLS_LANG; that is, JA16EUC.

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="text/html;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="text/html;charset=yourIANAencoding" />

  2. Edit the template.xsl (ORACLE_HOME/reports/templates/) 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="text/html;charset=yourIANAencoding" %>

    • Add or modify the <META> tag inside the tag:

      <meta http-equiv="Content-Type" content="text/html;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.2.2 About previewing JSP-based Web reports

You can preview a JSP-based Web report by clicking the Run Web Layout button in the toolbar, or by choosing Program > Run Web Layout, to run the Web Source. Reports Builder displays Web reports in your default browser.

Note:

If Netscape 7.0 is your default browser, and the browser does not display, set the registry key HKEY_CURRENT_USERS\Software\Oracle\Toolkit\Tkbrowser to the default browser location. Ensure that the BrowserName and the BrowserPath keys reflect the correct values. For example: BrowserName=Netscape 7; BrowserPath=C:\Program Files\Netscape\Netscape\Netscp.exe.

It is not necessary that you have Reports Server configured to use this functionality. Oracle Reports Builder uses the standalone Oracle WebLogic Server for running a report to Web layout.

Document Root

By default, the Oracle Reports Builder document root directory is
$DOMAIN_HOME/servers/<MANAGED_SERVER_NAME>/stage/reports/reports/web.war/
. This can be configured in the Oracle Reports Builder configuration file (rwbuilder.conf) as follows:

<webLayout 

  docroot="DOMAIN_HOME/servers/<MANAGED_SERVER_NAME>/stage/reports/reports/web.war/"/>

The end user can also override this configurable docroot from the command line using the WEBSERVER_DOCROOT command line keyword. If your JSP depends on external files, such as images, style sheets, and so on, make sure you copy them into the docroot directory. The docroot should point to any Oracle WebLogic Server component, $DOMAIN_HOME/servers/<MANAGED_SERVER_NAME>/stage/reports/reports/web.war/ directory where Reports Application has been deployed.

Web Server Port

By default, the OHS port is considered to be the Web server port. This can be configured in the Oracle Oracle Reports Builder configuration file (rwbuilder.conf) as follows:

<webLayout port="ohs_port"/>

The end user can override this configurable port parameter from the command line using the WEBSERVER_PORT command line keyword.

Usage notes

  • The large numbers in generated filenames are simply unique IDs, and have no particular meaning (for example, emp012345678.jsp).

  • The temporary files created in the docroot directory get cleaned up when you exit Oracle Reports Builder.

See also

Section 4.7.16.4, "Displaying report output in your Web browser"

Section 4.7.17.3, "Printing a report from your Web browser"

2.2.3 About Web links for HTML output

This topic discusses the Web links that you can add to paper-based reports that will become active when you generate your report to an HTML file and display it in a Web browser.

In most cases, you can define Web links in an object's Property Inspector. You can specify column and field names in the link value to create dynamic links at runtime. If you require more complex implementation of Web links, such as conditional settings, you must specify the link using PL/SQL and the Oracle Reports Builder built-in packaged procedure SRW.SET_ATTR.

Reports output in HTML format can include the following types of Web links:

  • A link from an object to another object within the same report, or to another HTML or PDF document (see Section 2.2.5, "About hyperlinks").

  • An identifier for the destination of a Web link (see Section 2.2.7, "About hyperlink destinations"). The destination can be any printable object (field, boilerplate, frame, and so on) in your report layout.

  • A string in a frame of the master HTML document that links to an associated object (see Section 2.2.8, "About bookmarks"). You can associate a bookmark with any printable object (field, boilerplate, frame, and so on) in your report layout. In the formatted report, you can click a bookmark to display the associated object at the top of the window.

  • URLs that specify image resources. The URLs must be available to your Web server so that the images can be located when the HTML output is displayed by the server.

  • A graph hyperlink to link areas of a graph to specified destinations.

Additionally, your report can include the following headers and footers that use escapes to add HTML tags to your paper-based report:

  • a document header (a before report escape) for placing a logo or some standard links at the beginning of an HTML document (see Section 2.2.10, "About before and after escapes").

  • a document footer (an after report escape) for placing a logo or some standard links at the end of an HTML document.

  • a page header (a before page escape) for placing a logo or some standard links at the beginning of one page or all pages in an HTML document.

  • a page footer (an after page escape) for placing a logo or some standard links at the end of one page or all pages in an HTML document.

  • a Parameter Form header (a before form escape) for placing a logo or some standard links in the header of the HTML Parameter Form.

  • a Parameter Form footer (an after form escape) for placing a logo or some standard links in the footer of the HTML Parameter Form.

2.2.4 About Web links for PDF output

This topic discusses the Web links that you can add to paper-based reports that will become active when you run your report to a PDF file and display it in a PDF viewer.

Reports output in PDF format can include the following types of Web links:

  • A link from an object to another object within the same report, or to another HTML or PDF document (see Section 2.2.5, "About hyperlinks").

  • An identifier for the destination of a Web link (see Section 2.2.7, "About hyperlink destinations"). The destination can be any printable object (field, boilerplate, frame, and so on) in your report layout.

  • A string in the bookmark area of the PDF viewer that links to an associated object (see Section 2.2.8, "About bookmarks"). You can associate a bookmark with any printable object (field, boilerplate, frame, and so on) in your report layout. In the formatted report, you can click a bookmark to display the associated object at the top of the window.

  • A link that executes a command when clicked (see Section 2.2.9, "About application command line links"). You can associate a command with any printable object (field, boilerplate, frame, and so on) in your report layout. In the formatted report, you can click the object to execute the associated command.

  • A graph hyperlink to link areas of a graph to specified destinations.

In most cases, you can define Web links in an object's Property Inspector. You can specify column and field names in the link value to create dynamic links at runtime. If you require more complex implementation of Web links, such as conditional settings, you must specify the link using PL/SQL.

2.2.5 About hyperlinks

A hyperlink is an attribute of an object that specifies a hypertext link to either of the following destinations:

  • an object identified with a hyperlink destination within the same report

  • another HTML or PDF document on the same machine or on a remote Web server

You can set the Additional Hyperlink Attributes property to specify additional HTML to be applied to the hyperlink.

See also

Section 4.6.10.1.8, "Creating a hyperlink using the Property Inspector"

Section 4.6.10.2.7, "Creating a hyperlink using PL/SQL"

2.2.6 About graph hyperlinks

A graph hyperlink provides an active link from an area of a graph to a specified destination in a Web report. When end users display the report on the Web (JSP-based, or paper-based PDF or HTML), they can click one or more areas of the graph to drill down to additional linked information.

See also

Section 4.6.8, "Adding a graph hyperlink"

2.2.7 About hyperlink destinations

A hyperlink destination is an attribute of an object that identifies the destination of a hypertext link.

See also

Section 4.6.10.1.7, "Creating a hyperlink destination using the Property Inspector"

Section 4.6.10.2.8, "Creating a hyperlink destination using PL/SQL"

2.2.9 About application command line links

(PDF output only) An application command line link is an attribute of an object that specifies a command line to be executed when the object is clicked.

Restrictions

An object that is associated with a application command line link cannot also be the source of a Web link (a hyperlink).

See also

Section 4.6.10.1.9, "Creating an application command line link using the Property Inspector"

Section 4.6.10.2.9, "Creating an application command line link using PL/SQL"

2.2.10 About before and after escapes

  • A before report escape specifies any text, graphics, or HTML commands that you want to appear at the beginning of your document.

  • An after report escape specifies any text, graphics, or HTML commands that you want to appear at the end of your document.

  • A before page escape specifies any text, graphics, or HTML commands that you want to appear at the beginning of one page or all pages of your document.

  • An after page escape specifies any text, graphics, or HTML commands that you want to appear at the end of one page or all pages of your document.

  • A before form escape specifies any text, graphics, or HTML commands that you want to appear at the top of the HTML Parameter Form.

  • An after form escape specifies any text, graphics, or HTML commands that you want to appear at the bottom of the HTML Parameter Form.

Limitations

In an after report escape (see Section 2.2.10, "About before and after escapes"), adding an HTML command outside the body does not reflect when the report is generated to spreadsheet output, even though the HTML command is written in output properly. For example:

</body><table><tr><td><B> the text to be bolded </B></td><tr></table> </html>

Adding the HTML command before the closing body tag reflect correctly when the report is generated to spreadsheet output. For example:

<table><tr><td><B> the text to be bolded </B></td><tr></table></body></html>

For more information about spreadsheet output, see Section 2.8.13, "About Enhanced Spreadsheet output".

See also

Section 4.6.10.1.1, "Creating an HTML document header using the Property Inspector"

Section 4.6.10.2.1, "Creating an HTML document header using PL/SQL"

Section 4.6.10.1.2, "Creating an HTML document footer using the Property Inspector"

Section 4.6.10.2.2, "Creating an HTML document footer using PL/SQL"

Section 4.6.10.1.3, "Creating an HTML page header using the Property Inspector"

Section 4.6.10.2.3, "Creating an HTML page header using PL/SQL"

Section 4.6.10.1.4, "Creating an HTML page footer using the Property Inspector"

Section 4.6.10.2.4, "Creating an HTML page footer using PL/SQL"

Section 4.6.10.1.5, "Creating an HTML Parameter Form header using the Property Inspector"

Section 4.6.10.2.5, "Creating an HTML Parameter Form header using PL/SQL"

Section 4.6.10.1.6, "Creating an HTML Parameter Form footer using the Property Inspector"

Section 4.6.10.2.6, "Creating an HTML Parameter Form footer using PL/SQL"

2.2.11 About style sheets

Style sheets (or Cascading Style Sheets) refer to HTML extensions that provide powerful formatting flexibility. With style sheet support, your HTML documents can include any of the following:

  • any font size or style

  • overlapping objects

  • horizontal and vertical lines and rectangles of any color or width

  • precise object positioning on a page

  • pagination

  • printing from a Web browser

  • inline image maps

This means that the sophisticated formatting in a report is preserved when you format the report as an HTMLCSS document. Without style sheet extensions, your HTML documents display only basic text formats and imported images. With style sheets, images of highly formatted text can be replaced with text objects of equivalent style, color, and font. Text objects can be positioned to overlay image objects. All text is fully searchable, and fewer images have to be downloaded.

To view an HTML document that takes advantage of style sheets, you must display it in a browser that supports style sheets.

Using external style sheets for HTMLCSS output

Every corporate Web site today uses style sheets to enforce the corporate look-and-feel across Web pages. External style sheets are Cascading Style Sheet (CSS) files that are referenced by these Web pages. End users typically want the same style used in pages on their Web site applied to their Web reports.

In prior releases, applying style sheets and user-defined styles to reports involved manually editing the HTMLCSS output.

You can specify user-defined styles and style sheets for HTMLCSS output using Oracle Reports Builder. Styles can be applied to report, field, text, frame, and repeating frame objects using the new properties Style Sheets, CSS Class Name, and CSS ID properties (see the Oracle Reports online Help for descriptions of these properties). The generated HTMLCSS output includes links to the style sheets and the user-defined styles are applied to the objects.

Restrictions

The following elements are not supported by HTML style sheet extensions:

  • ellipses, arcs, polygons/polylines, and diagonal lines

  • rounded rectangles (formatted as rectangles)

  • arrows on lines

  • dashes on lines or borders of objects

See also

Section 4.7.16.4, "Displaying report output in your Web browser"

Section 4.7.17.3, "Printing a report from your Web browser"