Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\TDPAX\td_bldedit.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>Editing the Employees Report</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="Editing the Employees Report" /> <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_bldedit.htm" title="Editing the Employees Report" type="text/html" /> <link rel="prev" href="td_bldaddrf.htm" title="Previous" type="text/html" /> <link rel="next" href="td_bldsellst.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> > Editing the Employees Report</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_bldaddrf.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="td_bldsellst.htm"><img src="../dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="BCEHFFEG" name="BCEHFFEG"></a></p> <div class="sect1"><!-- infolevel="all" infotype="General" --> <h1><a name="TDPAX04006|how to edit the Employees report"></a>Editing the <a id="sthref197" name="sthref197"></a><a id="sthref198" name="sthref198"></a>Employees Report</h1> <p>In this exercise, you run a SQL script to create a function that calculates employees' salaries. Then you add a column, Remuneration, to display that calculation in the Employees report.</p> <a id="sthref199" name="sthref199"></a> <p class="subhead2">Topics:</p> <ul> <li> <p><a href="#BCEIGGJE">Create a Function</a></p> </li> <li> <p><a href="#BCEJICBB">Add a Column</a></p> </li> <li> <p><a href="#BCEIIEEG">Previewing the Page</a></p> </li> <li> <p><a href="#BCEDCGDJ">Changing the Column Format</a></p> </li> </ul> <a id="BCEIGGJE" name="BCEIGGJE"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Create a <a id="sthref200" name="sthref200"></a><a id="sthref201" name="sthref201"></a><a id="sthref202" name="sthref202"></a><a id="sthref203" name="sthref203"></a>Function</h2> <p>First, create a function to calculate employees' salaries.</p> <p>To create a function:</p> <ol> <li> <p>Click the <span class="bold">Application</span> link on the Developer toolbar (at the bottom of the page).</p> <p>The Application home page appears.</p> </li> <li> <p>Click the <span class="bold">Home</span> breadcrumb link in the title bar.</p> <img src="img/home_brdcrmb.gif" alt="Description of home_brdcrmb.gif follows" title="Description of home_brdcrmb.gif follows" longdesc="img_text/home_brdcrmb.htm" /><br /> <a id="sthref204" name="sthref204" href="img_text/home_brdcrmb.htm">Description of the illustration home_brdcrmb.gif</a><br /> <br /></li> <li> <p>Click <span class="bold">SQL Workshop</span> and then <span class="bold">SQL Commands</span>.</p> <p>SQL Commands provides a window where you can run PL/SQL against the database.</p> </li> <li> <p>In the SQL editor, enter the following script:</p> <pre xml:space="preserve" class="oac_no_warn"> CREATE OR REPLACE FUNCTION calc_remuneration( salary IN number, commission_pct IN number) RETURN NUMBER IS BEGIN RETURN ((salary*12) + (salary * 12 * nvl(commission_pct,0))); END; </pre></li> <li> <p>Click <span class="bold">Run</span>.</p> <p>The Results section displays this message:</p> <pre xml:space="preserve" class="oac_no_warn"> Function created. </pre></li> </ol> </div> <!-- class="sect2" --> <a id="BCEJICBB" name="BCEJICBB"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Add a <a id="sthref205" name="sthref205"></a><a id="sthref206" name="sthref206"></a><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></a>Column</h2> <p>Next, add a column to display the results of the employees' salary calculations.</p> <p>To add a column:</p> <ol> <li> <p>Navigate to the Page Definition for page 3:</p> <ol> <li> <p>On the SQL Commands page, click the <span class="bold">Home</span> breadcrumb link.</p> </li> <li> <p>On the Workspace home page, click <span class="bold">Application Builder</span>.</p> </li> <li> <p>Select the <span class="bold">AnyCo Corp</span> application.</p> </li> <li> <p>Click <span class="bold">3 - Employees</span>.</p> <p>The Page Definition for page 3, Employees, appears.</p> </li> </ol> </li> <li> <p>Under Regions, click the <span class="bold">Employees</span> link (next to Report).</p> <img src="img/reg_emplrpt.gif" alt="Description of reg_emplrpt.gif follows" title="Description of reg_emplrpt.gif follows" longdesc="img_text/reg_emplrpt.htm" /><br /> <a id="sthref209" name="sthref209" href="img_text/reg_emplrpt.htm">Description of the illustration reg_emplrpt.gif</a><br /> <br /> <p>The <a id="sthref210" name="sthref210"></a>Region Definition appears.</p> </li> <li> <p>Scroll down to Source, and replace the existing code with the following:</p> <pre xml:space="preserve" class="oac_no_warn"> SELECT "EMPLOYEE_ID", "FIRST_NAME", "LAST_NAME", "HIRE_DATE", "SALARY", "COMMISSION_PCT", calc_remuneration(salary, commission_pct) REMUNERATION FROM "#OWNER#"."OEHR_EMPLOYEES" </pre></li> <li> <p>Click <span class="bold">Apply Changes</span>.</p> </li> </ol> </div> <!-- class="sect2" --> <a id="BCEIIEEG" name="BCEIIEEG"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Previewing the <a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></a><a id="sthref213" name="sthref213"></a><a id="sthref214" name="sthref214"></a>Page</h2> <p>To preview the page, click the <span class="bold">Run Page</span> icon in the upper right corner. Notice the addition of the Remuneration column.</p> <img src="img/bldap_empfrmrem.gif" alt="Description of bldap_empfrmrem.gif follows" title="Description of bldap_empfrmrem.gif follows" longdesc="img_text/bldap_empfrmrem.htm" /><br /> <a id="sthref215" name="sthref215" href="img_text/bldap_empfrmrem.htm">Description of the illustration bldap_empfrmrem.gif</a><br /> <br /></div> <!-- class="sect2" --> <a id="BCEDCGDJ" name="BCEDCGDJ"></a> <div class="sect2"><!-- infolevel="all" infotype="General" --> <h2>Changing the Column <a id="sthref216" name="sthref216"></a><a id="sthref217" name="sthref217"></a>Format</h2> <p>Next, change the format of the columns that contain numeric values.</p> <p>To change the column format:</p> <ol> <li> <p>Click <span class="bold">Edit Page 3</span> on the Developer toolbar (at the bottom of the page).</p> <p>The Page Definition appears.</p> </li> <li> <p>Under Regions, click <span class="bold">Report</span>.</p> <p>The Report Attributes page appears.</p> </li> <li> <p>Locate the Column Attributes section.</p> <p>Next, change the column and heading alignment for the appropriate columns.</p> </li> <li> <p>For Column Alignment, select <span class="bold">right</span> for <code>SALARY</code>, <code>COMMISSION_PCT</code>, and <code>REMUNERATION</code>.</p> </li> <li> <p>For Heading Alignment, select <span class="bold">center</span> for <code>SALARY</code>, <code>COMMISSION_PCT</code>, and <code>REMUNERATION</code>.</p> <p>Next, edit the format of the value in the column.</p> </li> <li> <p>To edit the format of <code>SALARY</code>:</p> <ol> <li> <p>Under Column Attributes, click the <span class="bold">Edit</span> icon next to <code>SALARY</code>.</p> <img src="img/edit_icon_col.gif" alt="Description of edit_icon_col.gif follows" title="Description of edit_icon_col.gif follows" longdesc="img_text/edit_icon_col.htm" /><br /> <a id="sthref218" name="sthref218" href="img_text/edit_icon_col.htm">Description of the illustration edit_icon_col.gif</a><br /> <br /> <p>The Column Attributes page appears.</p> </li> <li> <p>For Number/Date Format, select <span class="bold">$5,234.10</span> from the list.</p> <p>Notice that the appropriate format mask appears in the field.</p> </li> <li> <p>Click <span class="bold">Apply Changes</span>.</p> </li> </ol> </li> <li> <p>Repeat the previous step for <code>REMUNERATION</code>.</p> </li> <li> <p>Click the <span class="bold">Run Page</span> icon in the upper right corner to preview the page.</p> <p>Notice that the numbers in the Salary and Remuneration columns now appear with the dollar sign, include commas and decimals, and are correctly aligned.</p> <img src="img/bldap_emprptnum2.gif" alt="Description of bldap_emprptnum2.gif follows" title="Description of bldap_emprptnum2.gif follows" longdesc="img_text/bldap_emprptnum2.htm" /><br /> <a id="sthref219" name="sthref219" href="img_text/bldap_emprptnum2.htm">Description of the illustration bldap_emprptnum2.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_bldaddrf.htm"><img src="../dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="td_bldsellst.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