Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\TDPAX\td_bldemprpts.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> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Linking the Employees and Departments Reports</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T18:17:40Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Linking the Employees and Departments Reports" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E11946-01" /> <link rel="copyright" href="../dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="../dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="up" href="preface.htm" title="Home" type="text/html" /> <link rel="up" href="build_app.htm" title="Building Your Application" type="text/html" /> <link rel="up" href="td_bldemprpts.htm" title="Linking the Employees and D..." type="text/html" /> <link rel="prev" href="td_bldlink.htm" title="Previous" type="text/html" /> <link rel="next" href="td_bldcolval.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface.htm" title="Home">Home</a> > <a href="build_app.htm" title="Building Your Application">Building Your Application</a> > Linking the Employees and D...</p> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="td_bldlink.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="td_bldcolval.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BCECEDHD" name="BCECEDHD"></a></p> <div class="sect1"><!-- infolevel="all" infotype="General" --> <h1><a name="TDPAX04009|how to link the Employees and Departments report"></a>Linking the Employees and <a id="sthref242" name="sthref242"></a><a id="sthref243" name="sthref243"></a><a id="sthref244" name="sthref244"></a>Departments Reports</h1> <p>In this exercise, you link the Employees and Departments reports. To perform this task, you create a region and item on the Employees page to enable the user to select a department. You then modify the Employees report to only display the employees that belong to the selected department.</p> <a id="sthref245" name="sthref245"></a> <p class="subhead2">Topics:</p> <ul> <li> <p><a href="#BCECEFCH">Creating a Region</a></p> </li> <li> <p><a href="#BCEJJIDC">Creating an Item</a></p> </li> <li> <p><a href="#BCEBGAJB">Linking the Item to the Report</a></p> </li> <li> <p><a href="#BCEGIHBA">Creating a Branch</a></p> </li> </ul> <a id="BCECEFCH" name="BCECEFCH"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Creating a <a id="sthref246" name="sthref246"></a><a id="sthref247" name="sthref247"></a><a id="sthref248" name="sthref248"></a>Region</h2> <p>First, create a region on the Employees page to hold the Department select list.</p> <p>To create a region:</p> <ol> <li> <p>Navigate to the Page Definition for the Employees page, page 3.</p> </li> <li> <p>In the Regions section, click the <span class="bold">Create</span> icon.</p> </li> <li> <p>For Region:</p> <ol> <li> <p>Identify the type of region to add to this page - Accept the default, <span class="bold">HTML</span>, and click <span class="bold">Next</span>.</p> </li> <li> <p>Select the type of HTML region container you want to create - Accept the default, <span class="bold">HTML</span>, and click <span class="bold">Next</span>.</p> </li> </ol> </li> <li> <p>For Display Attributes:</p> <ol> <li> <p>Title - Enter <code>Department</code>.</p> </li> <li> <p>Region Template - Select <span class="bold">No Template</span>.</p> <p>This option adds a region <span class="italic">without</span> a region title.</p> </li> <li> <p>Sequence - Change to <code>5</code> so that this region displays above Employees.</p> </li> <li> <p>Accept the remaining defaults and click <span class="bold">Next</span>.</p> </li> </ol> </li> <li> <p>Click <span class="bold">Create Region</span>.</p> <p>Note the Regions section now lists a Department region of type HTML.</p> <img src="img/reg_sect_depthtml.gif" alt="Description of reg_sect_depthtml.gif follows" title="Description of reg_sect_depthtml.gif follows" longdesc="img_text/reg_sect_depthtml.htm" /><br /> <a id="sthref249" name="sthref249" href="img_text/reg_sect_depthtml.htm">Description of the illustration reg_sect_depthtml.gif</a><br /> <br /></li> </ol> </div> <!-- class="sect2" --> <a id="BCEJJIDC" name="BCEJJIDC"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Creating an <a id="sthref250" name="sthref250"></a><a id="sthref251" name="sthref251"></a><a id="sthref252" name="sthref252"></a>Item</h2> <p>Next, create an item in the Department regions. The item is a select list using the Department list of values.</p> <p>To create an item:</p> <ol> <li> <p>Under Items, click the <span class="bold">Create</span> icon.</p> </li> <li> <p>For Item Type:</p> <ol> <li> <p>Select Item Type - Select <span class="bold">Select List</span> and click <span class="bold">Next</span>.</p> </li> <li> <p>Select List Control Type - Select <span class="bold">Select List with Submit</span> and click <span class="bold">Next</span>.</p> <p>This option refreshes the page whenever a change is made to the select list.</p> </li> </ol> </li> <li> <p>For Display Position and Name:</p> <ol> <li> <p>Item Name - Change to <code>P3_DEPARTMENT_ID</code>.</p> </li> <li> <p>Sequence - Accept the default, <span class="bold">10</span>.</p> </li> <li> <p>Region - Select <span class="bold">Department (1) 5</span>.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ol> </li> <li> <p>For List of Values:</p> <ol> <li> <p><a id="sthref253" name="sthref253"></a>Named LOV - Select <span class="bold">DEPARTMENTS</span>.</p> <p>Departments appears in the select list because you created it as a shared component, which enables you to use it in other pages.</p> </li> <li> <p><a id="sthref254" name="sthref254"></a>Display Null Option - Accept the default, <span class="bold">Yes</span>.</p> </li> <li> <p><a id="sthref255" name="sthref255"></a>Null Text - Enter the following:</p> <pre xml:space="preserve" class="oac_no_warn"> - No Department Assigned - </pre></li> <li> <p><a id="sthref256" name="sthref256"></a>Null Value - Enter the following:</p> <pre xml:space="preserve" class="oac_no_warn"> -1 </pre> <p>Entering a null value makes it easier for you to write your query and to default your value to that entry. In this case, whenever a user selects <span class="bold">- No Department Assigned -</span>, the session state for this item is set to -1, and you can use that value in a query.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ol> </li> <li> <p>For Item Attributes, change the Label to <code>Department</code> and click <span class="bold">Next</span>.</p> </li> <li> <p>For Source:</p> <ol> <li> <p>Default - Enter <code>-1</code>.</p> </li> <li> <p>Accept the remaining defaults.</p> </li> <li> <p>Click <span class="bold">Create Item</span>.</p> </li> </ol> </li> </ol> </div> <!-- class="sect2" --> <a id="BCEBGAJB" name="BCEBGAJB"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Linking the Item to the <a id="sthref257" name="sthref257"></a><a id="sthref258" name="sthref258"></a><a id="sthref259" name="sthref259"></a><a id="sthref260" name="sthref260"></a>Report</h2> <p>At this point, you have created the item, but it is not linked to the report. To link it to the report, you must edit the Region Source and add a <code>WHERE</code> clause.</p> <p>To link the item to the report:</p> <ol> <li> <p>Under Regions, click the <span class="bold">Employees</span> link (next to Report).</p> </li> <li> <p>Scroll down to Source.</p> </li> <li> <p>In Region Source, add the following after the existing code:</p> <pre xml:space="preserve" class="oac_no_warn"> WHERE (DEPARTMENT_ID = :P3_DEPARTMENT_ID or (DEPARTMENT_ID is null and nvl(:P3_DEPARTMENT_ID,'1') = '-1')) </pre> <p>This <code>WHERE</code> clause changes the query to display only those employees that belong to the selected department.</p> </li> <li> <p>Click <span class="bold">Apply Changes</span>.</p> </li> </ol> </div> <!-- class="sect2" --> <a id="BCEGIHBA" name="BCEGIHBA"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Creating a <a id="sthref261" name="sthref261"></a><a id="sthref262" name="sthref262"></a><a id="sthref263" name="sthref263"></a>Branch</h2> <p>When a page is submitted, the branches defined for the page determine which page to display next. Because you want this page to redisplay when a user submits it, create a branch to the same page.</p> <p>To create a branch:</p> <ol> <li> <p>Under Page Processing, Branches, click the <span class="bold">Create</span> icon.</p> <img src="img/pgproc_branch.gif" alt="Description of pgproc_branch.gif follows" title="Description of pgproc_branch.gif follows" longdesc="img_text/pgproc_branch.htm" /><br /> <a id="sthref264" name="sthref264" href="img_text/pgproc_branch.htm">Description of the illustration pgproc_branch.gif</a><br /> <br /></li> <li> <p>For Point and Type, accept the defaults and click <span class="bold">Next</span>.</p> </li> <li> <p>For Target:</p> <ol> <li> <p>Page - Enter <code>3</code>.</p> </li> <li> <p>Select the <span class="bold">reset pagination for this page</span> check box.</p> <p>When you select the reset pagination option, the application displays the first set of data meeting a user's query. Otherwise, if the user was on the third page of data and then selected another department, the user would see the third page of data for the revised query.</p> </li> <li> <p>Click <span class="bold">Next</span>.</p> </li> </ol> </li> <li> <p>Click <span class="bold">Create Branch</span>.</p> </li> <li> <p>Run the page.</p> </li> <li> <p>From the Department select list, select <span class="bold">Accounting</span>.</p> <p>Note that the list displays only those employees belonging to that department.</p> <img src="img/bldap_deptfilter.gif" alt="Description of bldap_deptfilter.gif follows" title="Description of bldap_deptfilter.gif follows" longdesc="img_text/bldap_deptfilter.htm" /><br /> <a id="sthref265" name="sthref265" href="img_text/bldap_deptfilter.htm">Description of the illustration bldap_deptfilter.gif</a><br /> <br /></li> </ol> </div> <!-- class="sect2" --></div> <!-- class="sect1" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="../dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="td_bldlink.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="td_bldcolval.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de