oracle application express (apex)

25
Oracle Application Express (APEX) Project Implementation for COSC 5050 Distributed Database Applications Lab3

Upload: keagan

Post on 14-Feb-2016

81 views

Category:

Documents


6 download

DESCRIPTION

Oracle Application Express (APEX). Project Implementation for COSC 5050 Distributed Database Applications Lab3. Creating APEX Reports. Creating and customizing report Column format (date/time, price) Column sorting Pagination Creating parameterized report Creating drill down report. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Oracle Application Express (APEX)

Oracle Application Express (APEX)

Project Implementation for COSC 5050 Distributed Database Applications

Lab3

Page 2: Oracle Application Express (APEX)

Creating APEX ReportsCreating and customizing report

Column format (date/time, price)Column sortingPagination

Creating parameterized reportCreating drill down report

Page 3: Oracle Application Express (APEX)

Oracle APEX ReportAn Oracle APEX report is the formatted

result of a SQL queryReports can be generated by defining a

report region based on a SQL queryCreate a report based on a custom SQL

SELECT statement

Page 4: Oracle Application Express (APEX)

Editing Report AttributesCustomizing reports

SQL report and interactive reportAccessing the report attributes page from

report regionColumn attributesLayout and paginationSortingReport export/downloadBreak formatting

Page 5: Oracle Application Express (APEX)

Editing Report AttributesAltering report layout using column

attributes

Page 6: Oracle Application Express (APEX)

Editing Report AttributesAltering column nameAlignmentSortPagination – number of rowsReport export – CSV, xmlSum of columnFormatting number and date/timeColumn move up/down

Page 7: Oracle Application Express (APEX)

Creating Parameterized ReportParameterized report

The results depend on the form inputThe report region is based on a SQL query that

references the value of form items within the application

Will createA blank pageA search region

Form items Submit button

A query regionA process

Page 8: Oracle Application Express (APEX)

Creating a Blank PageUse AnyCo Corp application and add a new

blank pageIn the application home

Create Page Blank Page NextPage name: Parameterized ReportBreadcrumb: BreadcrumbBreadcrumb parent entry: Home

Page 9: Oracle Application Express (APEX)

Creating a Blank PageTab options

Use an existing tab set and create a new tab within the existing tab set

Tab set: TS1 (Home, Department, Employee)New tab label: Parameterized Report

Page 10: Oracle Application Express (APEX)

Creating a Search RegionCreate a search region

Edit the page right click Regions CreateRegion: HTML HTMLTitle: SearchTake other defaults Create

Page 11: Oracle Application Express (APEX)

Creating a Query RegionCreate a query region

Regions CreateType of region: Report Classic ReportTitle: Employee &P??_TEXT.

&P??_TEXT is a substitution string P?? is the page number, use your current page number Do not forget the period at the end, it is needed as

part of the titleEnter SQL Query (change to your page number)Column Heading Sorting: YesTake other defaults Create Region

Page 12: Oracle Application Express (APEX)

The Decode FunctionThe function has the functionality of an IF-THEN-ELSE

statementSyntax for the decode function

decode ( expression , search , result [, search , result]... [, default] )

Expression -- the value to compareSearch -- the value that is compared against expressionResult -- the value returned, if expression is equal to

searchDefault is optional

If no matches are found, the decode will return default If default is omitted, then the decode statement will return null

(if no matches are found)

Page 13: Oracle Application Express (APEX)

Testing the Created RegionsTwo regions have been created

HTML search regionSQL query report region

Page 14: Oracle Application Express (APEX)

Adding Form ItemsAdd following form items in the HTML search

regionThe search employee text field for P??_ENAMEA hidden text field for P??_TEXTThe department select list for P??_DEPTA submit button

Add a process to set the hidden text field

Page 15: Oracle Application Express (APEX)

Search Employee Text FieldCreate search employee text field for P??

_ENAMEEdit the page right click Search Create

Page Item Text fieldItem name: P??_ENAME

(use your page number)Region: SearchLabel: Search EmployeeTake other defaults Create Item

Page 16: Oracle Application Express (APEX)

Hidden FieldCreate hidden field for P??_TEXT

Edit the page right click Search Create Page Item Hidden

Item name: P??_TEXT (use your page number)Region: Employee &P??_TEXT. Take other defaults Create Item

Page 17: Oracle Application Express (APEX)

Department Select ListCreate department select list for P??_DEPT

Edit the page right click Search Create Page Item Select List

Item name: P??_DEPT (use your page number)Region: SearchLabel: DepartmentNull display value: – All –List of value query: Take other defaults Create Item

Page 18: Oracle Application Express (APEX)

Department Select List

Page 19: Oracle Application Express (APEX)

Submit ButtonTo submit the page, add a submit button

Once the user enters search criteria, the page needs to be submitted so that the query will be rerun against that criteria

Create buttonEdit the page right click Search Create Page Item ButtonButton name: P??_GOButton label: GoTake other defaults Create Button

Page 20: Oracle Application Express (APEX)

ProcessCreate a process that sets the value for the

hidden item P??_TEXT.The value of P??_TEXT determines the region

titleCreate process

In Page Processing area, right click Processes create

Category of process PL/SQLName: get region title infoEnter PL/SQL page process:Take other defaults Create Process

Page 21: Oracle Application Express (APEX)

Run Parameterized Report

Page 22: Oracle Application Express (APEX)

Creating Drill Down ReportLinking the Department report to the

Employee reportEdit department report page (page 2)In the Regions area:

Department Edit report Attributes

Page 23: Oracle Application Express (APEX)

Creating Drill Down ReportLinking the Department report to the Employee

reportEdit DETPNO column Column LinkLink text: #DEPTNO# (this is a template

substitution)Target: Page in this applicationPage: 5 (target to Parameterized Report page, use

your page number)Set item 1 session state

Name: P??_DEPT Value: #DEPTNO#

Apply Changes

Page 24: Oracle Application Express (APEX)

Creating Drill Down ReportClick department number to drill down to

employee report for the choose department

Page 25: Oracle Application Express (APEX)

ReadingsApplication Express User’s Guide

Building an Application Creating Reports

Application Express Advanced TutorialsHow to create a parameterized reportHow to create a drill down report