Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\tutorial\rprt_drill.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <!-- Run date = February 23, 2005 16:58:37 --> <meta name="Generator" content=" Oracle DARB XHTML converter - Version 4.1.3 Build 116" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title> How to Create a Drill Down Report</title> <link rel="stylesheet" type="text/css" href="blafdoc.css" title="default" /> <link rel="stylesheet" type="text/css" href="darbbook.css" title="default" /> <link rel="prev" href="rprt_query.htm" title="Previous" /> <link rel="next" href="frm_layout.htm" title="Next" /> <link rel="up" href="toc.htm" title="Up" /> <link rel="contents" href="toc.htm" title="Contents" /> <link rel="copyright" href="./support/html/cpyr.htm" title="Copyright" /> <link rel="index" href="index.htm" title="Index" /> </head> <body> <div class="header"> <a id="top" name="top"></a> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <tr> <td align="left" valign="top"> <b>Oracle® HTML DB Guide to Building Applications </b> <br /> <b>Release 2.0 </b> </td> <td valign="bottom" align="right"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="225"> <tr><td> </td> <td align="center" valign="top"><a href="toc.htm"><img src="./support/gifs/toc.gif" alt="Go To Table Of Contents" border="0" /><br /><span class="icon">Contents</span></a></td> </table> </td> </tr> </table> <hr /> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100"> <tr> <td align="center"> <a href="rprt_query.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="frm_layout.htm"> <img src="./support/gifs/rightnav.gif" alt="Next" border="0" /><br /><span class="icon">Next</span></a> </td> <td> </td> </tr> </table> </div><!-- class="header" --> <div class="IND"> <!-- End Header --><a id="CIHGBADI" name="CIHGBADI"></a><a id="sthref45" name="sthref45"></a> <h1><a name="HTMAD003"></a>How to Create a Drill Down Report</h1> <p>A drill down report is a type of report that displays summary data with links to related detail data in a second report. </p> <p>This tutorial describes how to create a report on the <code>DEMO_ORDERS</code> table with links to drill down to detail data in the <code>DEMO_ORDER_ITEMS</code> table. Both tables are installed with the demonstration application, <span class="italic">Sample Application</span>. </p> <p class="subhead2">Topics:</p> <ul> <li type="disc"> <p><a href="#BABFDHCF">About Sample Application</a> </p> </li> <li type="disc"> <p><a href="#CIHEEDDE">Creating a New Application </a> </p> </li> <li type="disc"> <p><a href="#CIHGBIBH">Creating Reports for DEMO_ORDERS and DEMO_ORDER_ITEMS</a> </p> </li> <li type="disc"> <p><a href="#BABBEAJF">Customizing the DEMO_ORDER_ITEMS Report</a> </p> </li> <li type="disc"> <p><a href="#BABDEFBJ">Linking the DEMO_ORDERS Report to the DEMO_ORDER_ITEMS Report</a> </p> </li> </ul><a id="BABFDHCF" name="BABFDHCF"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref46" name="sthref46"></a> <h2>About Sample Application </h2> <p>Oracle HTML DB installs with a number of demonstration applications. To complete this exercise you must install the demonstration application, <span class="italic">Sample Application</span>. </p> <p>To see if <span class="italic">Sample Application</span> is installed: </p> <ol type="1" start="1"> <li> <p>Log in to Oracle HTML DB. </p> </li> <li> <p>From the Workspace Administration list, select <span class="bold">Review Demonstration Applications</span>. </p> </li> <li> <p>Locate Sample Application and check the Status column: </p> <ol type="a"> <li> <p>If the Status column displays <span class="bold">Installed</span>, return to the Workspace home page. </p> </li> <li> <p>If the Status column displays <span class="bold">Not Installed</span>, select <span class="bold">Install</span> in the Action column. </p> </li> <li> <p>Follow the on-screen instructions. </p> </li> </ol> </li> </ol> </div><!-- class="sect1" --> <a id="CIHEEDDE" name="CIHEEDDE"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref47" name="sthref47"></a> <h2>Creating a New Application </h2> <p>First, create a new application. </p> <p>To create an application: </p> <ol type="1" start="1"> <li> <p>From the Application Builder home page, click <span class="bold">Create Application</span>. </p> </li> <li> <p>On Select Creation Method, select <span class="bold">From Scratch</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Create Application: </p> </li> <li> <ol type="a"> <li> <p>For Name, enter <code>Drilldown Reports</code>. </p> </li> <li> <p>From Pages, select <span class="bold">2</span>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Tabs, accept the default <span class="bold">One Level of Tabs</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Page Names: </p> <ol type="a"> <li> <p>For Page 1, enter Orders. </p> </li> <li> <p>For Page 2, enter Order Items. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>For Page Tab Name, accept the defaults and click <span class="bold">Next</span>. </p> </li> <li> <p>On Theme, select Theme 2 and click <span class="bold">Next</span>. </p> </li> <li> <p>Review your selections and click <span class="bold">Create Application</span>. </p> </li> </ol> </div><!-- class="sect1" --> <a id="CIHGBIBH" name="CIHGBIBH"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref48" name="sthref48"></a> <h2>Creating Reports for DEMO_ORDERS and DEMO_ORDER_ITEMS </h2> <p>Next, you need to create reports for the <code>DEMO_ORDERS</code> and the <code>DEMO_ORDER_ITEMS</code> tables. </p> <p class="subhead2">Topics:</p> <ul> <li type="disc"> <p><a href="#BABIBHHI">Create a Report for DEMO_ORDERS</a> </p> </li> <li type="disc"> <p><a href="#BABHJJCI">Create a Report for DEMO_ORDER_ITEMS</a> </p> </li> </ul><a id="BABIBHHI" name="BABIBHHI"></a> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref49" name="sthref49"></a> <h3>Create a Report for DEMO_ORDERS </h3> <p>To create a report on the <code>DEMO_ORDERS</code> table: </p> <ol type="1" start="1"> <li> <p>On the Application Builder home page, click <span class="bold">Create Page</span>. </p> </li> <li> <p>Select <span class="bold">Page with Component</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Select Component Type, select <span class="bold">Report</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Create Page, select <span class="bold">Easy Report</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Page Attributes: </p> <ol type="a"> <li> <p>For Page, enter 1. </p> </li> <li> <p>In Page Title and Region Title, enter <code>Orders</code>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Identify Tabs, accept the default <span class="bold">Do not use tabs</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Tabls(s) and Columns: </p> <ol type="a"> <li> <p>For Table/View Owner, select the appropriate schema. </p> </li> <li> <p>For Table/View, select <span class="bold">DEMO_ORDERS</span>. </p> </li> <li> <p>From the Available Columns list, move the following columns to the Displayed Columns list: </p> <pre xml:space="preserve" class="oac_no_warn">ORDER_ID, ORDER_TOTAL, ORDER_TIMESTAMP </pre> <p>Next, create a join with the <code>DEMO_CUSTOMERS</code> table to display the customer name. </p> </li> <li> <p>From the Table/View list, select <span class="bold">DEMO_CUSTOMERS</span>. </p> </li> <li> <p>From the Available Columns list, select <span class="bold">CUST_LAST_NAME</span> and move it to the Display Columns list. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Join Conditions, accept the join by clicking <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Report Options, accept the defaults and click <span class="bold">Next</span>. Click <span class="bold">Create Report Page</span>. </p> </li> <li> <p>Run by page by clicking <span class="bold">Run Page</span>. If prompted for a user name and password, enter your workspace credentials in lowercase letters. </p> <p>As shown in <a href="#BABHGADE">Figure 3-1</a>, a report on the <code>DEMO_ORDERS</code> table appears. </p> <div class="figure"> <a id="BABHGADE" name="BABHGADE"></a><a id="sthref50" name="sthref50"></a> <p class="titleinfigure">Figure 3-1 Report on DEMO_ORDERS Table</p> <img src="./img/drill_order.gif" alt="Description of drill_order.gif follows" title="Description of drill_order.gif follows"/> <br /><a id="sthref51" name="sthref51" href="./img_text/drill_order.htm">Description of the illustration drill_order.gif</a> <br /><br /> </div><!-- class="figure" --> </li> <li> <p>Select <span class="bold">Edit Application</span> from the Developer Toolbar to return to Application Builder. </p> </li> </ol> </div><!-- class="sect2" --> <a id="BABHJJCI" name="BABHJJCI"></a> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref52" name="sthref52"></a> <h3>Create a Report for DEMO_ORDER_ITEMS </h3> <p>To create a report on the <code>DEMO_ORDER_ITEMS</code> table: </p> <ol type="1" start="1"> <li> <p>On the Application Builder home page, click <span class="bold">Create Page</span>. </p> </li> <li> <p>Select <span class="bold">Page with Component</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Select Component Type, select <span class="bold">Report</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Create Page, select <span class="bold">Easy Report</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Page Attributes: </p> <ol type="a"> <li> <p>For Page, enter 2. </p> </li> <li> <p>In Page Title and Region Title, enter <code>Order Items</code>. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Identify Tabs, accept the default <span class="bold">Do not use tabs</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Tabls(s) and Columns: </p> <ol type="a"> <li> <p>For Table/View Owner, select the appropriate schema and click <span class="bold">Next</span>. </p> </li> <li> <p>For Table/View, select <span class="bold">DEMO_ORDER_ITEMS</span>. </p> </li> <li> <p>From the Available Columns list, move the following columns to the Displayed Columns list: </p> <pre xml:space="preserve" class="oac_no_warn">ORDER_ITEM_ID, ORDER_ID, UNIT_PRICE, QUANTITY </pre> <p>Next, create a join with the <code>DEMO_PRODUCT_INFO</code> table to display the product name. </p> </li> <li> <p>For Show Only Related Tables, select <span class="bold">No</span>. </p> </li> <li> <p>From the Table/View list, select <span class="bold">DEMO_PRODUCT_INFO</span>. </p> </li> <li> <p>From the Available Columns list, select <span class="bold">PRODUCT_NAME</span> and move it to the Display Columns list. </p> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>On Identify Report Options, accept the defaults and click <span class="bold">Next</span>. Click <span class="bold">Create Report Page</span>. </p> </li> <li> <p>Run by page by clicking <span class="bold">Run Page</span>. </p> <p>As shown in<a href="#BABIGHIA">Figure 3-2</a>, a report on the <code>DEMO_ORDER_ITEMS</code> table appears. </p> <div class="figure"> <a id="BABIGHIA" name="BABIGHIA"></a><a id="sthref53" name="sthref53"></a> <p class="titleinfigure">Figure 3-2 Report on DEMO_ORDER_ITEMS Table</p> <img src="./img/drill_demo_order.gif" alt="Description of drill_demo_order.gif follows" title="Description of drill_demo_order.gif follows"/> <br /><a id="sthref54" name="sthref54" href="./img_text/drill_demo_order.htm">Description of the illustration drill_demo_order.gif</a> <br /><br /> </div><!-- class="figure" --> </li> </ol> </div><!-- class="sect2" --> </div><!-- class="sect1" --> <a id="BABBEAJF" name="BABBEAJF"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref55" name="sthref55"></a> <h2>Customizing the DEMO_ORDER_ITEMS Report </h2> <p>Next, you need to customize the Order Items page. In this exercise, you add an item to hold the value of the ORDER_ID, add a condition that constrains the report by the value of ORDER_ID item, and modify the Region Title to note which order is being viewed. </p> <p class="subhead2">Topics:</p> <ul> <li type="disc"> <p><a href="#BABCGGCJ">Add an Item to Hold the Value of ORDER_ID</a> </p> </li> <li type="disc"> <p><a href="#BABHEDGD">Add a Condition</a> </p> </li> <li type="disc"> <p><a href="#BABBHFIF">Modify the Region Title</a> </p> </li> </ul><a id="BABCGGCJ" name="BABCGGCJ"></a> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref56" name="sthref56"></a> <h3>Add an Item to Hold the Value of ORDER_ID </h3> <p>To create an item to hold the value of ORDER_ID: </p> <ol type="1" start="1"> <li> <p>Navigate to the Page Definition of page 2. Select <span class="bold">Edit Page</span> from the Developer Toolbar. </p> </li> <li> <p>Under Items, click the <span class="bold">Create</span> icon. </p> </li> <li> <p>On Choose Item Type, select <span class="bold">Hidden and click Next</span>. </p> </li> <li> <p>For the Item Name, enter <code>P2_ORDER_ID</code> and click <span class="bold">Next</span>. </p> </li> <li> <p>Click <span class="bold">Create Item</span>. </p> </li> </ol> </div><!-- class="sect2" --> <a id="BABHEDGD" name="BABHEDGD"></a> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref57" name="sthref57"></a> <h3>Add a Condition </h3> <p>To add a condition to the DEMO_ORDER_ITEMS report: </p> <ol type="1" start="1"> <li> <p>Under Regions, select <span class="bold">Order Items</span>. </p> </li> <li> <p>Select the <span class="bold">Query Definition</span> tab. </p> </li> <li> <p>Click <span class="bold">Add/Modify Conditions</span>. </p> </li> <li> <p>On the Conditions page: </p> <ol type="a"> <li> <p>From the Columns list, select ORDER_ID [DEMO_ORDER_ITEMS]. </p> </li> <li> <p>Enter the following in the Conditions field: </p> <pre xml:space="preserve" class="oac_no_warn">= :P2_ORDER_ID </pre> </li> </ol> </li> <li> <p> Click <span class="bold">Apply Changes</span>. </p> </li> </ol> </div><!-- class="sect2" --> <a id="BABBHFIF" name="BABBHFIF"></a> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref58" name="sthref58"></a> <h3>Modify the Region Title </h3> <p>To modify the region title of the DEMO_ORDER_ITEMS report: </p> <ol type="1" start="1"> <li> <p>Under Regions, click <span class="bold">Order Items</span>. </p> </li> <li> <p>In Title replace this existing text with the following: </p> <pre xml:space="preserve" class="oac_no_warn">Order Items for Order # &P2_ORDER_ID. </pre> </li> <li> <p>Click <span class="bold">Apply Changes</span>. </p> </li> </ol> </div><!-- class="sect2" --> </div><!-- class="sect1" --> <a id="BABDEFBJ" name="BABDEFBJ"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref59" name="sthref59"></a> <h2>Linking the DEMO_ORDERS Report to the DEMO_ORDER_ITEMS Report </h2> <p>Lastly, you link the DEMO_ORDERS report to the DEMO_ORDER_ITEMS report. To accomplish this, you edit the attributes of the <code>ORDER_ID</code> column on the DEMO_ORDERS report and create a link. The link will populate the P2_ORDER_ID hidden item on page 2 with the clicked ORDER_ID. </p> <p>To create a link from the <code>ORDER_ID</code> column on the Orders report to the Order Items report: </p> <ol type="1" start="1"> <li> <p>Navigate to the Page Definition of page 1. Enter <code>1</code> in the Page field and click <span class="bold">Go</span>. </p> </li> <li> <p>Under Regions, select <span class="bold">Orders</span>. </p> </li> <li> <p>Click the <span class="bold">Report Attributes</span> tab. </p> </li> <li> <p>Click the <span class="bold">Edit</span> icon adjacent to ORDER_ID. </p> </li> <li> <p>Scroll down to Column Link: </p> <ol type="a"> <li> <p>In the Page field, select <span class="bold">2</span>. </p> </li> <li> <p>From the Item 1 Name list, select <span class="bold">P2_ORDER_ID</span>. </p> </li> <li> <p>From the Item 1 Value list, select<span class="bold"> #ORDER_ID#</span>. </p> </li> <li> <p>From the Link Text list, select <span class="bold">#ORDER_ID#</span>. </p> </li> </ol> </li> <li> <p>Click <span class="bold">Apply Changes</span>. </p> </li> <li> <p>Click the <span class="bold">Run Page</span> icon. </p> <p>As shown in <a href="#BABCADEG">Figure 3-3</a>, you can link to page 2 by clicking on an Order Id. </p> <div class="figure"> <a id="BABCADEG" name="BABCADEG"></a><a id="sthref60" name="sthref60"></a> <p class="titleinfigure">Figure 3-3 DEMO_ORDERS Report with LInk to Page 2</p> <img src="./img/drill_link.gif" alt="Description of drill_link.gif follows" title="Description of drill_link.gif follows"/> <br /><a id="sthref61" name="sthref61" href="./img_text/drill_link.htm">Description of the illustration drill_link.gif</a> <br /><br /> </div><!-- class="figure" --> </li> </ol> </div><!-- class="sect1" --> </div> <!-- Start Footer --> <div class="footer"> <hr /> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <tr> <td valign="bottom" width="33%"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100"> <tr><td> </td> <td align="center"> <a href="rprt_query.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="frm_layout.htm"> <img src="./support/gifs/rightnav.gif" alt="Next" border="0" /><br /><span class="icon">Next</span></a> </td> </tr> </table> </td> <td class="copyrightlogo"> <a href="./support/html/cpyr.htm"> <span class="copyrightlogo"> Copyright © 2005, Oracle. All rights reserved. </span> </a> </td> <td valign="bottom" align="right" width="33%"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="225"> <tr><td> </td> <td align="center" valign="top"><a href="toc.htm"><img src="./support/gifs/toc.gif" alt="Go To Table Of Contents" border="0" /><br /><span class="icon">Contents</span></a></td> </table> </td> </tr> </table> </div><!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de