apex

Upload: raiyaans

Post on 30-Oct-2015

46 views

Category:

Documents


0 download

DESCRIPTION

Oracle Application Express Basics of Reporting

TRANSCRIPT

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved.

    Course Overview

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 1 - 2

    Course Objectives

    After completing this course, you should be able to do the following: Manage application navigation by using hierarchical lists

    with images, database-driven navigation, site maps, and dashboards

    Build custom tabular forms that use collections and validations

    Define client-side behaviors Create and customize Plug-ins Extend your application to add binary large object (BLOB)

    data, send email notifications, use RESTful Web services, and integrate with SQL Developer

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 1 - 3

    Course Objectives

    Manipulate application content through templates, themes, and style sheets

    Create reports declaratively and use the print APIs Use advanced charting techniques Secure your application by using Lightweight Directory

    Access Protocol (LDAP) and prevent SQL injection attacks and cross-site scripting and usage of Session State Protection

    Monitor and manage your application by using custom reports

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved.

    Managing Application Navigation

    Preview

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 2

    Objectives

    After completing this lesson, you should be able to: Differentiate between various navigation objects (tabs,

    breadcrumbs, lists, navigation bar entries, and trees) Build a hierarchical list with images Build a database-driven navigation report Build a site map Add a dashboard Incorporate security into navigation Link interactive reports Manage feedback

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 3

    Navigation Choices

    2

    3 1 4

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 4

    Building a Hierarchical List with Images

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 5

    Building a Hierarchical List with Images

    Steps 1. Update the list with the desired sublist items. 2. Identify and upload the images to include. 3. Change the template of the list region. 4. Change navigation region settings. 5. Associate an image with a list item.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 6

    Building a Database-Driven Navigation Report

    This report is used to navigate between pages by using links defined against values in the database. 1. Create a report based on a column. 2. Create a link to page and pass ID value.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 7

    Building a Site Map

    A site map is used to navigate between pages by page title. 1. Create a page group with the pages you want to appear in

    the site map. 2. From Activity, create SQL from the

    APEX_APPLICATION_PAGES view. 3. Create a report that shows

    the page name. 4. Create a link from the item

    to #PAGE_ID#. 5. Modify the report to use the

    desired templates.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 8

    Adding a Navigation Bar Entry

    To access the site map, create a navigation bar entry: 1. From Shared Components, select Navigation Bar Entry. 2. Click Create. 3. Select From Scratch and click Next. 4. Select Navigation to URL and click Next. 5. Enter Site Map for Entry Label click Next. 6. Select the site map page from the Page drop-down list and

    click Next. 7. Click Create.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 9

    Enforcing Authorization on Your Site Map

    Showing an entry on the site map based on authorization requires the following: 1. Create a function that checks for authorization. 2. Update the SQL query on the report to check whether the

    function is true.

    Administrator

    Developer

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 10

    Adding a Dashboard Page

    A dashboard page provides a dynamic overview of your application.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 11

    Linking Interactive Report Regions

    Provide a declarative filter where value is Passed from one interactive report region to another.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 12

    Managing Feedback

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 3 - 13

    ora01 ora02

    Test (beta) System Development System

    Export/Import Feedback

    Export/Import Feedback Response

    Synchronizing Beta and Development Feedback

  • Building Custom Tabular Forms

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 2

    Objectives

    After completing this lesson, you should be able to: Build a custom tabular form Add validations to your tabular form Manage changes to the tabular form by using collections

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 3

    What Is a Tabular Form?

    A tabular form allows users to update multiple rows in a table concurrently from a single page.

    Declarative

    Manual

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 4

    Building a Tabular Form Manually

    Build a SQL report. Create an Update button. Add a process to perform the update.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 5

    SQL Report Query

    Uses the APEX_ITEM API to create a query.

    SELECT apex_item.hidden(1,employee_id) || apex_item.display_and_save(2,last_name) last_name , apex_item.text(3,email,8) email , apex_item.date_popup(4,null,hire_date,'DD-MON-YYYY',10,null,null, lpad(to_char(rownum),4,'0')) hiredate , apex_item.select_list_from_query(5,job_id,'select distinct job_id, job_id from oehr_employees',10) job , apex_item.text(6,salary,6) salary , apex_item.text(7,commission_pct,6) commission , apex_item.popupkey_from_query(8,manager_id,'select last_name, employee_id from oehr_employees',10) manager , apex_item.select_list_from_query(10,department_id,'select department_name, department_id from oehr_departments',10) dname FROM oehr_employees

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 7

    PL/SQL Process: Using the APEX_APPLICATION API

    Create a PL/SQL process with the following code:

    for i in 1..apex_application.g_f01.count loop update oehr_employees set email = apex_application.g_f03(i), hire_date = apex_application.g_f04(i), job_id = apex_application.g_f05(i), salary = apex_application.g_f06(i), commission_pct = apex_application.g_f07(i), manager_id = replace(apex_application.g_f08(i),'%'||'null%',NULL), department_id =

    replace(apex_application.g_f10(i),'%'||'null%',NULL) where employee_id = apex_application.g_f01(i); end loop;

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 8

    Not Null PL/SQL Validation

    Ensures that valid values are entered before the data is updated in the database

    After the error message is displayed, click Back in your browser to return to

    the tabular form.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 9

    Adding a Not Null PL/SQL Validation

    Page-level PL/SQL validation with Function Returning Error Text on the Error page

    FOR i IN 1..apex_application.g_f01.count LOOP IF apex_application.g_f01(i) IS NOT NULL THEN IF apex_application.g_f03(i) IS NULL THEN RETURN 'Email must have some value.'; END IF; IF apex_application.g_f04(i) IS NULL THEN RETURN 'Hire Date must have some value.'; END IF; IF apex_application.g_f06(i) IS NULL THEN RETURN 'Salary must have some value.'; END IF; END IF; END LOOP;

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 4 - 10

    Creating and Using a Collection on a Tabular Form

    1. Create a process to load the collection. 2. Create a query against the collection. 3. Modify the report attributes. 4. Create a button and process to add a row to the collection. 5. Create a process to update the collection. 6. Create a button and process to delete a row from the

    collection. 7. Update the database from the collection. 8. Change the validation to use the collection.

  • Defining Client-Side Behaviors

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 2

    Objectives

    After completing this lesson, you should be able to: Describe dynamic actions Explain the two types of dynamic actions: standard and

    advanced Create advanced dynamic actions to define complex client-

    side behavior such as the following: Changing the class when an item is null Disabling a button when an item is null Highlighting an item when the value of another item changes Setting the value of an item when another item changes Deleting and re-creating a row in a report

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 3

    Dynamic Actions

    Use dynamic actions to define complex client-side behavior declaratively.

    Two types of dynamic actions: Standard Advanced

    Example of using a standard dynamic action

    Example of using an advanced dynamic action

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 4

    Creating and Using Advanced Dynamic Actions: Examples

    This lesson covers the following examples of creating and using advanced dynamic actions in Application Express. Changing the class when an item is null Disabling a button when an item is null Highlighting an item when the value of another item

    changes Setting the value of an item when another item changes Deleting and re-creating a row in a report

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 5

    Changing the Class When an Item Is Null

    A red border is applied when a user

    leaves the Last Name field empty.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 6

    Disabling a Button When an Item Is Null

    Last Name and Salary are not null and Apply Changes

    button is enabled.

    Last Name is null and Apply Changes button

    is disabled.

    Salary is null and Apply Changes

    button is disabled.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 7

    Highlighting an Item When the Value of Another Item Changes

    Selecting a department id refreshes the manager id select list.

    The Manager Id field is highlighted when

    refreshed.

    Austin

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 8

    Setting the Value of an Item When Another Item Changes

    Job Id changes the commission percentage.

    Salary changes the commission percentage.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 9

    Deleting and Re-Creating a Row in a Report

    The first row is deleted. To re-create,

    click Recreate Employees.

  • Copyright 2010, Oracle and/or its affiliates. All rights reserved. 5 - 10

    Refreshing the Data in a Report Using Custom Filters

    Filtering the report based on department

    Filtering the report based on department and job

    Course OverviewCourse ObjectivesCourse Objectivespreview_D47999GC20_les03.pdfManaging Application NavigationObjectivesNavigation ChoicesBuilding a Hierarchical List with ImagesBuilding a Hierarchical List with ImagesBuilding a Database-Driven Navigation ReportBuilding a Site MapAdding a Navigation Bar EntryEnforcing Authorization on Your Site MapAdding a Dashboard PageLinking Interactive Report RegionsManaging FeedbackSynchronizing Beta and Development Feedback

    preview_D47999GC20_les04.pdfBuilding Custom Tabular FormsObjectivesWhat Is a Tabular Form? Building a Tabular Form Manually SQL Report Query PL/SQL Process:Using the APEX_APPLICATION API Not Null PL/SQL Validation Adding a Not Null PL/SQL Validation Creating and Using a Collection on a Tabular Form

    preview_D47999GC20_les05.pdfDefining Client-Side BehaviorsObjectivesDynamic ActionsCreating and Using Advanced Dynamic Actions: ExamplesChanging the Class When an Item Is NullDisabling a Button When an Item Is NullHighlighting an Item When the Value of Another Item ChangesSetting the Value of an Item When Another Item ChangesDeleting and Re-Creating a Row in a ReportRefreshing the Data in a Report Using Custom Filters