Building and Customizing an Interactive Report in Oracle Application Express 4.2
Overview
Purpose
This tutorial shows you how to build, use, and customize an Interactive Report in Oracle Application Express.Note: Some screenshots in this tutorial may be slightly different depending on what browser or operating system you use.
Time to Complete
Approximately 60 minutes.
Introduction
Interactive Reporting Regions enable end users to customize reports. Users can alter the layout of report data by choosing the columns they are interested in, applying filters, highlighting, and sorting. They can also define breaks, aggregations, different charts, and their own computations. Users can create multiple variations of the report and save them as named reports and download to various file formats including comma-delimited file (CSV) format, Microsoft Excel (XLS) format, Adobe Portable Document Format (PDF), and Microsoft Word Rich Text Format (RTF). For further information, click on help and search on Interactive Reports.
Another feature shown in this tutorial is Application Date Format. You can define a date format that will be used throughout your application. This date format will be used to alter the NLS_DATE_FORMAT database session setting prior to showing or submitting any page within the application. This format is used by all reports showing dates and is also picked up by form items of type 'Date Picker (use Application Date Format)'. This can be set using:
- Application Builder > Application Builder Defaults (under Tasks): These are specific to a Workspace, not a developer, and will be used as the default when using the create application wizard.
- Application Builder > Create Application Wizard > Attributes page
- Application Builder > Your Application > Shared Components > Edit Globalization Attributes
This tutorial shows the developer how to create and customize an Interactive Report for an end user.
Please keep in mind the following while running this tutorial:
- Logging into your Oracle Application Express workspace
- Your Oracle Application Express workspace may reside in an
on-premise Oracle Database or in Oracle Database Cloud Service
(Database Schema).
The login credentials differ depending on where your workspace is located:
Logging into Oracle Application Express workspace in Oracle Database Cloud (Schema):
From your browser, go to the Service URL found in your Welcome email or the Service URL provided by your Service Administrator.Logging in to Oracle Application Express on-premise:
From your browser, go to the location of your on-premise installation of your Oracle Application Express workspace provided by your Workspace Administrator. - Application ID - Screenshots in this tutorial show an Application ID of 111. Your Application ID may be different.
- Schema - If you are accessing an Oracle Application Express workspace in Oracle Database Cloud Service (Schema) you have one schema assigned to you with a schema name that you cannot change. If you are accessing the workspace in an on-premise Oracle database, you may have more than one schema assigned to your workspace by the Oracle Application Express Instance Administrator.
Prerequisites
Before starting this tutorial, you should:
- Have access to an Oracle Database 11g or later database, either on-premise or in the Oracle Database Cloud Service (Database Schema).
- Have installed Oracle Application Express Release 4.2 into your Oracle Database (for on-premise only).
- At least one Oracle Application Express user provisioned. See
Creating
New User Accounts in Oracle Application Express
Administration Guide.
Creating an Application with an Interactive Report
In this topic, you create an application with an Interactive Report. To create an Interactive Report, login to your Oracle Application Express workspace, either on-premise or in Oracle Database Cloud Service (Schema), and perform the following steps:
-
Select the drop down next to Application Builder and select Database Applications
-
Click Create >.
- Enter an Application Name and click Next >.
- Make sure Blank is selected for Page Type, enter Home for Page Name and click Add Page.
- Select Report and Form for Page Type, select Home (1) for Subordinate to Page, make sure Implementation is set to Interactive. Click the Drop-Down arrow to select a table in the Table Name field.
- Select the DEMO_PRODUCT_INFO table and click Add Page.
- Click Next >.
- Accept the default and click Next >.
- You want to specify the type of authentication used to access this application. Select the List of Values icon for Authentication Scheme and choose Application Express. Also, you can specify a Date Format for the entire application. Click the List of Values icon for Date Format.
- Select the 12-JAN-2004 link. Note: By setting the date format when you create the application, the same date format will be used for all report columns and items.
- Click Next >.
- Some of the themes have been updated in Application Express 4.2. In this tutorial, you want to select Theme 26 and click Next >.
- Click Create Application.
- Click the Run Application icon.
- If the login screens appears, enter the user's Oracle Application Express credentials and click Login.
- The Home page is displayed, select the Demo Product Info to view the report.
-
The Report is displayed. Notice that the date format is set according to the date you specified when you created the application. In the next section, you examine some of the Interactive Report features.
Click the Edit Page link in the developer toolbar.
Adding Images to Your Interactive Report
You can add images to your Interactive Report. In this section, you add a product image for each product. Perform the following steps:
-
You want to change your query for this interactive report. Under Regions > Body, right-click DEMO_PRODUCT_INFO and select Edit.
-
Click the Source subtab.
-
Change the SQL Statement to the following and click Apply Changes.
select p.product_id,
p.product_name,
p.product_description,
p.category,
p.product_avail,
p.list_price,
(select sum(quantity) from demo_order_items where product_id = p.product_id) units,
(select max(o.order_timestamp) od from demo_orders o, demo_order_items i where o.order_id = i.order_id and i.product_id = p.product_id) last_date_sold,
p.PRODUCT_ID image
from demo_product_info p -
Click Apply Changes to confirm the report region changes in the query.
-
You also want to make some changes to the Report Attributes. Under Regions > Body, right-click DEMO_PRODUCT_INFO and select Edit Report Attributes.
-
Change the fields below that are in bold and select the edit link for the IMAGE field.
Attribute Heading Display Text As PRODUCT_ID Product Id Display as Text (escape special characters) PRODUCT_NAME Name Display as Text (escape special characters) PRODUCT_DESCRIPTION Description Display as Text (escape special characters) CATEGORY Category Display as Text (escape special characters) PRODUCT_AVAIL Available Display as Text (escape special characters) LIST_PRICE Price Display as Text (escape special characters) UNITS Units Display as Text (escape special characters) LAST_DATE_SOLD Last Sale Display as Text (escape special characters) IMAGE Image Display as Text (escape special characters)
-
You need to define the way in which the blob will be displayed in the report. Select Standard Report Column for Display Type and click List of Values icon.
-
Select the BLOB Format link.
-
Enter the following values.
Field Value Format Mask IMAGE BLOB Table DEMO_PRODUCT_INFO BLOB Column PRODUCT_IMAGE Primary Key Column 1 PRODUCT_ID MIME Type Column MIMETYPE Filename Column FILENAME BLOB Last Updated Column IMAGE_LAST_UPDATE Content Disposition Inline
Manipulating Your Interactive Report
Now that the Interactive Report has been created, you can manipulate the report in many ways. In this section, only some of them are discussed. You can review more on this topic in the OBE- Using Interactive Report Regions with Oracle Application Express 4.2. Perform the following steps:
-
Specify the following and click Apply.
Field Value Group By Column Name Function Percent of Total Sum Column **Sales Label Total Percent of Sales Sum <select check box>
Customizing Your Interactive Report
As a developer you can change the way the Interactive Report is rendered for all users. Perform the following steps:
Summary
- Create an Application with an interactive report
- Add an image to your interactive report
- Manipulate and customize your interactive report
- Oracle Application Express homepage on OTN.
- Oracle Learning Library
- Oracle University
- Lead Curriculum Developers: Veerabhadra Rao Putrevu, Drue Swadner
- Original Curriculum Developer: Dimpi Sarmah
- Other Contributors: David Peake, Chaitanya Koratamaddi
In this tutorial, you have learned how to:
Resources
Credits
To navigate this Oracle by Example tutorial, note the following:
- Topic List:
- Click a topic to navigate to that section.
- Expand All Topics:
- Click the button to show or hide the details for the sections. By default, all topics are collapsed.
- Hide All Images:
- Click the button to show or hide the screenshots. By default, all images are displayed.
- Print:
- Click the button to print the content. The content that is currently displayed or hidden is printed.
To navigate to a particular section in this tutorial, select the topic from the list.