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

29.4 Modify Your JSP Report to Display in Microsoft Excel

Now that you have created your JSP-based Web report, which looks the same as your paper report, you will modify it further to display the report in Microsoft Excel in your Web browser.

First, copy myexcelreport_your_initials.jsp to the deployment directory of your Application Server. For testing purposes, in this example, we will use the Oracle WebLogic Server instance shipped with the Oracle Developer Suite.

For more information on deploying a JSP-based Web report, refer to the section "Deploying Your Reports" in the chapter "Running Report Requests" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual

To modify the report to display in Microsoft Excel:

  1. In the Report Editor, click the Web Source button in the toolbar to display the Web Source view.

    In the Web Source view, you will change the content type of the HTTP response using the JSP directive contentType, so that the browser opens Microsoft Excel to display your report output.

  2. In the Web Source view, find the following text:

    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp"
    session="false" %>
    <%@ page contentType="text/html;charset=ISO-8859-1" %>
    <rw:report id="report">
    <rw:objects id="objects">
    </rw:objects>
    ......
    ......
    <!--
    </rw:report>
    -->
    

    and modify it to read as follows:

    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    <%@ page language="java" import="java.io.*" errorPage="/rwerror.jsp"
    session="false" %>
    <%@ page contentType="application/vnd.ms-excel;charset=ISO-8859-1" %> 
    <rw:report id="report">
    <rw:objects id="objects">
    </rw:objects>
    ......
    ......
    <!--
    </rw:report>
    -->
    
  3. Save your report.

  4. Copy the Web report (myexcelreport_your_initials.jsp)into the following directory:

    $DOMAIN_HOME\servers\MANAGED_SERVER_NAME\stage\reports\reports\web.war
    
  5. Start your Oracle WebLogic Server instance to enable the deployment of your report.

    • On Windows, you can do either of the following:

      • From the Start menu, choose Programs > Oracle Classic Instance > Reports Services > Start WebLogic Server - WLS_REPORTS.

        For example, the Oracle Classic Instance may be Oracle Classic Instance-asinst_1.

      • From the command line, run the following command:

        cd $DOMAIN_HOME\bin\startManagedServer.bat WLS_REPORTS

    • On UNIX, start the shell script from the command line:

      • $DOMAIN_HOME\bin\startManagedServer.sh WLS_REPORTS

    Tip:

    The Oracle WebLogic Server instance starts once the containers for Java EE have been initialized.

  6. Type the following URL to display your report in Microsoft Excel in your Web browser:

    http://your_computer:port/reports/yourexcelreportname.jsp?userid=hr/hr@db
    

    In our example, we use:

    http://mycomputer-pc:8888/reports/my_excel_report.jsp?userid=hr/hr@orcl
    

    Note:

    The connect string you type in the URL is for the database you used to create the data model in Section 29.2, "Create a Query and the Layout". For the purposes of this example, we have used plain text to pass the connect string. For information on using security, refer to the chapter "Securing Oracle Reports Services" in the Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services manual.

  7. The report runs, and the browser displays your report in Microsoft Excel.

    Note:

    If you want your report to display the same colors in Excel as in your report definition, you must use colors supported by the Excel color palette. Otherwise, Excel tries to match unsupported colors, but the match may not be what you expect.

    Your final report output should look something like this:

    Figure 29-4 Microsoft Excel Output of Your Report

    Description of Figure 29-4 follows
    Description of "Figure 29-4 Microsoft Excel Output of Your Report"