Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\tutorial\rprt_query.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 Parameterized 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="frm_tabular.htm" title="Previous" /> <link rel="next" href="rprt_drill.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="frm_tabular.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="rprt_drill.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="BGBEEBJA" name="BGBEEBJA"></a><a id="sthref33" name="sthref33"></a> <h1><a name="HTMAD002"></a>How to Create a Parameterized Report</h1> <p>In an Oracle HTML DB application, a report is the formatted result of a SQL query. You can generate reports in three ways: </p> <ul> <li type="disc"> <p>Running a built-in wizard </p> </li> <li type="disc"> <p>Defining a report region based on a SQL query </p> </li> <li type="disc"> <p>Creating a report region based on a PL/SQL function returning a SQL query </p> </li> </ul> <p>This tutorial illustrates how to create a report in which the results depend on the form input, or a parameterized report. In this exercise, you create a report region based on a SQL query which references the value of a form item within the application. </p> <p class="subhead2">Topics:</p> <ul> <li type="disc"> <p><a href="#BGBDCDAD">Sample Report Utilizing a Form Input</a> </p> </li> <li type="disc"> <p><a href="#BABHDADH">About Sample Application</a> </p> </li> <li type="disc"> <p><a href="#BGBEDIFA">Creating a New Page</a> </p> </li> <li type="disc"> <p><a href="#BGBHDCCH">Creating the Query Region</a> </p> </li> <li type="disc"> <p><a href="#BGBBAABF">Adding an Item</a> </p> </li> <li type="disc"> <p><a href="#BABIGBAH">Adding a Button to Submit the Page</a> </p> </li> </ul><a id="BGBDCDAD" name="BGBDCDAD"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref34" name="sthref34"></a> <h2>Sample Report Utilizing a Form Input </h2> <p><a href="#BGBEIDAC">Figure 2-1</a> is an example of a form in which the report results are based on user input. In this example, this user populates the form by making a selection from the Show list. The easiest way to create this type of report in Oracle HTML DB is to define a report region based on a SQL query. </p> <div class="figure"> <a id="BGBEIDAC" name="BGBEIDAC"></a><a id="sthref35" name="sthref35"></a> <p class="titleinfigure">Figure 2-1 Sample Report</p> <img src="./img/rpt_input_eg.gif" alt="Description of rpt_input_eg.gif follows" title="Description of rpt_input_eg.gif follows"/> <br /><a id="sthref36" name="sthref36" href="./img_text/rpt_input_eg.htm">Description of the illustration rpt_input_eg.gif</a> <br /><br /> </div><!-- class="figure" --> </div><!-- class="sect1" --> <a id="BABHDADH" name="BABHDADH"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref37" name="sthref37"></a> <h2>About Sample Application </h2> <p>Oracle HTML DB installs with a number of demonstration applications. In this exercise you will create a tabular form within 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="BGBEDIFA" name="BGBEDIFA"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref38" name="sthref38"></a> <h2>Creating a New Page </h2> <p>First, you create a new blank page and within <span class="italic">Sample Application</span>. </p> <p>To create a new page: </p> <ol type="1" start="1"> <li> <p>Navigate to the Workspace home page. </p> </li> <li> <p>From the Available Applications list, select <span class="bold">Sample Application</span>. </p> </li> <li> <p>Click the <span class="bold">Create Page</span> button. </p> </li> <li> <p>On Create new Page, select <span class="bold">Blank Page</span> and click <span class="bold">Next</span>. </p> </li> <li> <p> For Page, enter 700 and click <span class="bold">Next</span>. </p> </li> <li> <p>For Name, enter <code>Ordered Products</code> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Tabs, accept the default <span class="bold">No</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>Review your selections and click <span class="bold">Finish</span>. </p> </li> <li> <p>On the Success Page, click <span class="bold">Edit Page</span>. </p> <p>The Page Definition for page 700 appears. </p> </li> </ol> </div><!-- class="sect1" --> <a id="BGBHDCCH" name="BGBHDCCH"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref39" name="sthref39"></a> <h2>Creating the Query Region </h2> <p>Next, you need to create a report. </p> <p>To create a the query region: </p> <ol type="1" start="1"> <li> <p>Under Regions, click the <span class="bold">Create</span> icon. </p> </li> <li> <p>On Identify Region Type, select <span class="bold">Report</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Report Implementation, select <span class="bold">SQL Report</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Region Attributes: </p> <ol type="a"> <li> <p>For Title, enter <code>Ordered Products</code>. </p> </li> <li> <p>Accept the remaining default values and click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>Enter following SQL query: </p> <pre xml:space="preserve" class="oac_no_warn">SELECT p.category, p.product_name, i.quantity FROM demo_product_info p, demo_order_items i WHERE p.product_id = i.product_id AND ( p.category = :P700_SHOW or :P700_SHOW = 'ALL' ) </pre> </li> <li> <p>Click <span class="bold">Create Region</span>. </p> </li> </ol> </div><!-- class="sect1" --> <a id="BGBBAABF" name="BGBBAABF"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref40" name="sthref40"></a> <h2>Adding an Item </h2> <p>The previous SQL query references an item named P700_SHOW. </p> <p>To create the select list P700_SHOW: </p> <ol type="1" start="1"> <li> <p>Under Items, click the <span class="bold">Create</span> icon. </p> </li> <li> <p>On Choose Item Type, select <span class="bold">Select List</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Pick Select List Control Type, accept the default of <span class="bold">Select List</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Item Name, enter P700_SHOW and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify List of Values: </p> <ol type="a"> <li> <p>For Named LOV, select <span class="bold">CATEGORIES</span>. </p> </li> <li> <p>For Null Text, enter: </p> <pre xml:space="preserve" class="oac_no_warn">- All Categories - </pre> </li> <li> <p>For Null Value, enter: </p> <pre xml:space="preserve" class="oac_no_warn">ALL </pre> </li> <li> <p>Click <span class="bold">Next</span>. </p> </li> </ol> </li> <li> <p>Identify Item Attributes, accept the defaults and click <span class="bold">Next</span>. </p> </li> <li> <p>Click <span class="bold">Create Item</span>. </p> </li> </ol> </div><!-- class="sect1" --> <a id="BABIGBAH" name="BABIGBAH"></a> <div class="sect1"> <!-- infolevel=all infotype=General --><a id="sthref41" name="sthref41"></a> <h2>Adding a Button to Submit the Page </h2> <p>For the report to be driven by the Product Category select list (the form input), you need to submit the page. To accomplish this, you need add a button. </p> <p>To add a button to submit the page: </p> <ol type="1" start="1"> <li> <p>Under Buttons, click the <span class="bold">Create</span> icon. </p> </li> <li> <p>For Select a region, select <span class="bold">Ordered Products</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>On Identify Button Position, select <span class="bold">Create a button displayed among this region's items</span> and click <span class="bold">Next</span>. </p> </li> <li> <p>For Button Name, enter <code>P700_GO</code>. </p> </li> <li> <p> Click <span class="bold">Create Button</span>. </p> </li> </ol> <div class="sect2"> <!-- infolevel=all infotype=General --><a id="sthref42" name="sthref42"></a> <h3>Run the Page </h3> <p>To run the page: </p> <ol type="1" start="1"> <li> <p>Click <span class="bold">Run Page</span>. </p> </li> <li> <p>If prompted to enter a username and password: </p> <ol type="a"> <li> <p>For User Name, enter either <code>demo</code> or <code>admin</code>. </p> </li> <li> <p>For Password, enter the name of the current workspace using all lowercase letters. </p> </li> <li> <p>Click <span class="bold">Login</span>. </p> </li> <li> <p>Navigate to page 700: </p> <ul> <li type="circle"> <p>Select <span class="bold">Edit Page</span> from the Developer Toolbar. </p> </li> <li type="circle"> <p>In Page, enter <span class="bold">700</span> and click <span class="bold">Go</span>. </p> </li> <li type="circle"> <p>Click the <span class="bold">Run Page</span> icon. </p> </li> </ul> </li> </ol> </li> <li> <p>When the Order Products page appears, select <span class="bold">Computer</span> from the Show menu and click <span class="bold">Go</span>. </p> </li> </ol> <p>As shown in <a href="#BABHEBGG">Figure 2-2</a>, notice that making a selection from the Show menu populates the form. </p> <div class="figure"> <a id="BABHEBGG" name="BABHEBGG"></a><a id="sthref43" name="sthref43"></a> <p class="titleinfigure">Figure 2-2 Form Results Being Populated from a Select List</p> <img src="./img/rpt_frm_input.gif" alt="Description of rpt_frm_input.gif follows" title="Description of rpt_frm_input.gif follows"/> <br /><a id="sthref44" name="sthref44" href="./img_text/rpt_frm_input.htm">Description of the illustration rpt_frm_input.gif</a> <br /><br /> </div><!-- class="figure" --> </div><!-- class="sect2" --> </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="frm_tabular.htm"> <img src="./support/gifs/leftnav.gif" alt="Previous" border="0" /><br /><span class="icon">Previous</span></a> </td> <td align="center"> <a href="rprt_drill.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