Previous
Previous
 
Next
Next

Adding an Employees Report and Form

In this exercise, you add a report to display employee information and a form to create, update, and delete employee information.

To add an employee report and form:

  1. Click the Application ID link on the Developer toolbar (at the bottom of the page).

    The Application home page appears.

  2. Click Create Page.

  3. For Page:

    1. Select Form and click Next.

    2. Select Form on a Table with Report.

      This option creates two pages, a report and form, based on a single table or view.

    3. Click Next.

  4. For Table/View Owner, accept the default and click Next. This specifies the schema owner.

  5. For Table/View Name, select OEHR_EMPLOYEES and click Next.

  6. For Define Report Page, make these changes:

    1. Implementation - Select Interactive.

    2. Page Name - Change to Employees.

    3. Region Title - Change to Employees.

    4. Breadcrumb - Select Breadcrumb.

      The Create Breadcrumb Entry section appears.

    5. For Select Parent Entry, click the Home link.

      Home appears in the Parent Entry field.

    6. Click Next.

  7. For Define Report Page, accept the default, Do not use tabs, and click Next.

  8. For Define Report Page, press the CTRL key, select the following columns, and click Next:

    • EMPLOYEE_ID

    • FIRST_NAME

    • LAST_NAME

    • HIRE_DATE

    • SALARY

    • COMMISSION_PCT

    The columns you selected appear on the Report page when the page is run.

  9. For Define Report Page, accept the defaults and click Next.

    Note that the default Edit Link image resembles a small piece of paper and pencil.

    Next, define the page and region information for the form.

  10. For Define Form Page, edit the following:

    1. Page Name - Enter Create/Edit Employee

    2. Region Title - Enter Create/Edit Employee

    3. Entry Name - Enter Create/Edit Employee

    4. Click Next.

  11. For Primary Key, accept the defaults and click Next.

  12. In Define the source for the primary key columns, accept the default, Existing trigger, and click Next.

    Your table, OEHR_EMPLOYEES, already has a trigger that populates the primary key.

  13. In Select Column(s), select all columns and click Next.

    These columns appear in the Create/Edit Employee form when the page is run.

  14. In Identify Process Options, accept the defaults and click Next.

    These selections enable users to add, update, and create employee records.

  15. For Confirm, verify the information and click Finish.

Previewing the Pages

To preview the two pages you just created, run the current page. From the Employees report, you can then preview the form.

To preview the pages:

  1. Click the Run Page icon.

    Description of runpg_afterwiz.gif follows
    Description of the illustration runpg_afterwiz.gif

    The Employees report appears.

    Description of bldap_emprpt.gif follows
    Description of the illustration bldap_emprpt.gif

    Note the following about the Employees report:

    • The Search Bar with the Actions menu appears at the top. For more information, see "Using an Interactive Report".

    • The column headings are links that enable the user to quickly perform various sorting, filtering and reformatting operations. For more information, see "Using an Interactive Report".

    • The Edit icon you selected appears in each row. You can click the Edit icon to update the employee record. Since you created a form based on a table with a report, the wizard automatically linked the report to the form. If you create just a report, as is done in the previous section, "Creating the Initial Application", the wizard automatically links the report to the single row view.

    • The Create button appears in the upper right corner. You can click the Create button to add an employee to the underlying table.

    • The Employees report includes the six columns you specified. When you selected the columns and applied the changes, Oracle Application Express created the appropriate SQL code in the background to produce this result.

    Your data might appear in a different order. If so, ignore this difference and continue with these steps.

  2. To review the form you also created, click the Edit icon in an Employee row.

    The Create/Edit Employee form appears.

    Description of bldap_empeditfrm.gif follows
    Description of the illustration bldap_empeditfrm.gif

    Note the following about the Create/Edit Employee form:

    • The form includes Cancel, Delete, and Apply Changes buttons.

    • The Hire Date field displays a calendar, which is included because the data type of the underlying column is DATE.

    • Fields labeled in red require are mandatory and cannot be left blank or null.