You are on page 1of 62

Building and Customizing an Interactive Report

Purpose

This tutorial shows you how to build, use and customize an Interactive Report in Oracle Application Express 3.1.

Time to Complete

Approximately 30 minutes

Topics

This tutorial covers the following topics:

Overview
Prerequisites
Create an Application with an Interactive
Report
Manipulating Your Interactive Report
Customizing Your Interactive Report
Summary
Related Information

Viewing Screenshots

Place the cursor over this icon to load and view all screenshots for this tutorial. (Caution: This action loads
all screenshots simultaneously, so response time may be slow depending on your Internet connection.)

Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the
screenshot associated with that step. You can hide an individual screenshot by clicking it.

Overview

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 new 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:

1. 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.
2. Application Builder > Create Application Wizard > Attributes page
3. Application Builder > Your Application > Shared Components > Edit Globalization Attributes

To get more information about the 3.1 New Features, click here.

This tutorial shows the developer how to create and customize an Interactive Report for an end user.

Back to Topic List

Prerequisites

Before you perform this tutorial, you should:

1. Install Oracle Database 11g.


2. Install and configure Oracle Application Express. See documentation on OTN.
3. Create a Workspace and User in the Oracle Application Express Administration tool.

Back to Topic List

Create an Application with an Interactive Report

To create an Application with an Interactive Report , perform the following steps:

1. Enter the following URL to log in to Oracle Application Express (change the <hostname> to localhost, your specific
hostname or apex.oracle.com).

http://<hostname>:8080/apex

2. To log in to Oracle Application Express, enter the following details, and click Login.

Workspace: <your workspace name>


Username: <your username>
Password: <your password>
2. Click Application Builder.

3. Click Create.

4. Click Create Application.


5. Enter an Application Name and click Next.

6. Select Report for Page Type, make sure Page Source is set to Table and Implementation is set to Interactive. Click
the up arrow to select a table.
7. Select the OEHR_EMPLOYEES table.

8. Click Add Page.


9. Click Next.
10. Accept the default to create One Level of Tabs and click Next.

11. Click Next.

12. You want to accept the default authentication scheme. You can now in Application Express specify a Date Format
for the entire application. Click the up arrow for Date Format.
13. 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.
14. Click Next.

15. There are 2 new themes in Application Express 3.1: theme 19 and 20. In this tutorial, you want to select Theme 20
and click Next.
16. Click Create.
17. Run the Application.

18. Login with the username/password you use when you login to Application Express and click Login.

19. 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.
Back to Topic List

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 3.1. Perform the following steps:
1. You can search for values. Enter John in the search bar and click Go.

2. Notice that only the rows where john is found are listed. A filter was also created above the report data.
3. To hide a column, you can select the column header link and then click the hide icon column.

4. Notice that the column no longer appears in the report. Note: You can show the column again by clicking Select
Columns from the Actions menu (discussed later in this tutorial).
5. To sort on a column, click the header you want to sort on and select the Sort Ascending or Sort Descending icon.
Select the Last Name column and click the Sort Ascending icon.

6. The report is now sorted on Last Name.


7. You can delete the filter you created earlier. Click the red X next to the filter.

8. You can create a control break on a column. Select the Actions menu pulldown and select Control Break.
9. You want to break on the Department ID. Select Department ID from the list of columns and click Apply.
10. The control break was created. Notice that the column was eliminated in the list and now appears before each
breakpoint in the report.
11. You can also highlight a particular cell or row in the report based on some criteria. Click the Actions menu and select
Highlight.
12. You want to highlight the row of an employee if their salary is higher than $10,000. Enter Top Tier Salary for the
Name, make sure Enabled is set to Yes, and Highlight Type is set to Row. Select [red] for Background color and
[blue] for Text color. Under Highlight Condition, select Salary for the Column, select > for the Operator and 10000
for the Expression and click Apply.
13. Notice that a highlight rule was created at the top of the report and the rows that met the criteria are highlighted.
14. You can create a computed column. In this case, you will create a column to show the monthly salary for each
employee. Click the Actions menu and then select Compute.
15. Enter Monthly Salary for the column header and select the down arrow for Format Mask and select the $5,234.10
from the list.
16. From the list of Columns scroll down and select Salary. Notice that the letter corresponding to the column appears
in the computation area. This is the column alias. Click / in the keypad and then enter 12 after the / in the
computation area. Then click Apply.
17. Notice that the computed column now appears in the report.
18. You can also aggregate a particular column. Click the Actions menu and select Aggregate.
19. You want to total the Monthly Salary column. Select Sum for the Function and **Monthly Salary (the ** indicates
that the column is a computed column) for the Column. Then click Apply.
20. You now see a total salary for each department. Note: the aggregated column inherits any formatting from the base
column.
21. You can save all the customization you have made to this report. Click the Actions menu and select Save Report.
22. Enter My Report for the Name and click Apply. Note: Save as Named Report is available to all authenticated end
users (when saving reports is enabled for the region). The report settings are displayed as a tab above the report,
with the name you provide, and is visible *only* for the APP_USER who saved it. Save as Default Report Settings is
only available to developers. These settings are applied to anyone who comes to the page for the first time in a
session.
23. Notice that you now see a tab with all the display changes you made. This customized view will be available each
time you login.
24. You can view a record in the report by clicking the icon before the row you want to view.
25. The record is displayed.
26. To navigate back to the report, click Report View.

27. To show the original report (without the customizations), click the Working Report tab.
28. Click the Action menu and click Reset.
28. Click Apply.
29. The report is displayed. In the next section, you review some of the changes you can make to the report itself.
Back to Topic List

Customizing Your Interactive Report

As a developer you can change the way that the Interactive Report is rendered for all users. Perform the following steps:

1. Click the Edit Page 1 link in the Developer Toolbar.


2. Under Regions, select the Interactive Report link.
3. You can hide columns so that they do not appear in the report. For the EMPLOYEE_ID and PHONE_NUMBER,
select Hidden for Display Text As and click Apply Changes.

4. Run the page to see that the 2 columns are now hidden from the report. Note that the columns will also no longer
appear under Select Columns from the Actions menu. You want to make some additional changes, click Edit Page
1 in the Developer toolbar.
5. Under Regions, select the Interactive Report link again.
6. Select the Search Bar tab.
7. You can change the way that your Interactive report is rendered to the end user. You can change the search bar
and Actions menu in this section. In this case, deselect the Highlight check box. Then click the Download tab.

8. Notice that CSV is the only download format selected. Select XLS and PDF. Then click the Region Definition tab.
9. You can change the query that is executed when the report is run. In this case, you want to change the column for
DEPARTMENT_ID to the DEPARTMENT_NAME in the OEHR_DEPARTMENTS table. Click the Source tab.
10. Change the query to the following and click Apply Changes.

select
a."EMPLOYEE_ID",
a."FIRST_NAME",
a."LAST_NAME",
a."EMAIL",
a."PHONE_NUMBER",
a."HIRE_DATE",
a."JOB_ID",
a."SALARY",
a."COMMISSION_PCT",
a."MANAGER_ID",
b."DEPARTMENT_NAME"
from "OEHR_EMPLOYEES" a, "OEHR_DEPARTMENTS" b
where a."DEPARTMENT_ID"=b."DEPARTMENT_ID"

11. Since you modified the query, a confirmation window appears that tells you that you need to select Reset from the
Actions menu in order for you to see the changes in your report. Click Apply Changes.
12. Click Run Page 1 to see the changes you made.

13. The report is displayed. In order for the Department Name column to appear, you need to reset the report.
14. Select the Actions menu. Notice that the Highlight option is no longer in the list. Click Reset.

15. Click Apply.


16. The Department Name column is now shown.
17. To check that the other download options are displayed, click the Actions menu and select Download.
18. The three options you selected are displayed. Click PDF.

19. When the download dialogue appears, click OK (or Open depending on what browser you have) . The PDF is
displayed. In the Creating PDF Reports with Oracle Application Express 3.1 tutotial, you learn ways to format this
PDF file. Close this window.
20. Navigate to the Page 1 Page Definition. Under Regions, select the Interactive Report link again.

21. From the Interactive Report, you can create a group that will organize the single row view and group columns
together in Select Columns from the Actions menu. Click the Groups tab.
22. Click Add Group.
23. Enter Sensitive Data for the Group Name and click Create.

24. To add the columns to assign to the Sensitive Data Group, click the Edit icon.
25. Select Salary and Commission Pct from the list and click >. Then click Apply Changes.

26. Click Run Page 1.


27. Select the Single Row View icon in front of a row.

28. Notice that on the Single Row View page, the two columns are now grouped together. Click Report View to return
to the report.
29. You can also change what happens when the Single Row View icon is clicked. You can link to a custom page or
exclude the Single Row View from the report altogether. Navigate to the Page 1 Page Definition. Under Regions,
select the Interactive Report link again.

30. Click the Link Column tab.


31. Select the Link Column drop down list.

32. Notice that you can link to a Custom Target (or another page or URL) or Exclude this column altogether. Select
Exclude Link Column.
33. Click Apply Changes.
34. Click Run Page 1.

35. Notice that the Single Row View icon for each row in the report no longer appears.
Back to Topic List

Summary

In this tutorial, you learned how to:

Create an Application with an interactive report


Manipulate and customize your interactive
report

Back to Topic List

Related Information

To learn more about Application Express, you can review the following:

Related Documentation Description


Online Help To access this help, click the Help button displayed in the top right corner of Application
Express. Search on topics of interest.
Release Notes These notes contain important information not included in the Oracle Application
Express documentation.
Installation Guide This guide explains how to install and configure Oracle Application Express.
2 Day + Developer’s Guide This guide shows you how to set up a development environment or access a hosted
demonstration environment to use with this guide. It then walks you through building an
initial application, modifying it, and previewing it.
User’s Guide This guide describes how to use the Oracle Application Express development
environment to build and deploy database-centric Web applications. Oracle Application
Express turns a single Oracle database into a shared service by enabling multiple
workgroups to build and access applications as if they were running in separate
databases.
Advanced Tutorial Tutorials with step-by-step instructions that explain how to create a variety of
application components and entire applications using the Oracle Application Express
development environment.

Back to Topic List

Place the cursor over this icon to hide all screenshots.

You might also like