Lab 05
Lab 05
Lab 05
I. Objectives
At the end of today session, you should be able to perform the following:
Create tabular reports using the Oracle SQL Developer.
Create charts (i.e. bar and pie charts) using the Oracle SQL Developer.
Export reports (e.g. tabular reports and charts) to HTML and PDF.
II. Introduction
In today lab session, you will learn how to use the reporting tools in Oracle SQL developer to generate various
types of report. In specific, you will learn how to create a tabular report, a bar chart and a pie chart. These
reports will then be saved as a HTML and PDF.
You will be given a dataset in Excel format (Miniature.xlsx), which is downloadable from the
eLearn@USM. It consists of 30 rows of miniature sales of a company in different areas in Malaysia. Import the
dataset into the Oracle Database Express Edition 11g using Oracle SQL Developer. Name the table as
MINIATURE and the table should have a structure of six columns (i.e. TEAM, AREA, ORDERID, PRODUCT,
PRICE, and QUANTITY). Note that the data type for the PRICE and QUANTITY columns is Number and
Integer respectively. Further information on how to import data into the Oracle Database Express Edition
11g using Oracle SQL Developer can be found in Lab 03.
Check the existence of the Miniature table by expanding the Tables under the LOCAL connection instance.
The Miniature table is with 30 rows as shown in Figure 1.
i. Make sure the LOCAL schema is connected. Click Test Report and verify the output.
j. Click Apply to generate the report.
k. In the Reports pane, right click Sales Revenue Generated by WLP Team, and select HTML.
l. The Generate HTML dialog box is displayed as shown in Figure 6. Connect to LOCAL schema, provide
the destination of the HTML file, and check the two check boxes. Click Apply.
m. A report in HTML is displayed as shown in Figure 7.
Congratulations! You have learned how to generate a tabular report using Oracle SQL Developer and save the
tabular report in HTML format.
You can use SQL Developer to create PDF versions of the Sales Revenue Generated by WLP Team
report and add password protection for the mentioned report. In order to do so, follow the steps below:
a. In the Reports pane, under the User Defined Reports, right click the Sales Revenue
Generated by WLP Team report which you created previously and select Edit.
b. In the Master Report tree, expand PDF to reveal the settings that can be applied to your PDF
reports. There are seven different settings under the PDF, namely: Binary Large Object, Cell
Layout, Column Layout, Table Layout, Header and Footer, Security, and Page
Layout. In this lab session, Column Layout, and Header and Footer are focused.
c. Click Column Layout. Select All Pages for the Header to provide a header on each page of the
report. See Figure 8.
e. Click Apply. When the Sales Revenue Generated by WLP Team report is opened, you can
export it into PDF. Right-click inside the Sales Revenue Generated by WLP Team report and
select Export. See Figure 10.
f. Export Wizard is showed. Select pdf for the format. It is optional to provide title, subject, and keywords.
h. Click Next. In the Export Summary, confirm your selections, and then click Finish.
i. The Sales Revenue Generated by WLP Team PDF report will be displayed.
Q1: Create a tabular report in HTML and PDF. The report displays the top five sales revenue generated in different
areas irrespective to any team. The areas with the highest sales revenue must be listed first. Provide the SQL
statement which is used to generate such report in your lab report. Your report should contain a table with the
following rows.
Figure 12: Pie charts show the sales revenue generated by different teams.
i. Click Property. Select Pie Multiple for the chart type. See Figure 14.
j. Click Plot Area. Check the Data Labels. Select Series Label and % Value for slice labels.
See Figure 15.
k. Make sure the LOCAL schema is connected. Click Test Report and verify the output.
l. Click Apply to generate the report. When the report is exported as HTML. Your report should looks as
follows:
Your report must be submitted to your respective teaching assistant, before the lab ends. Failure to submit the
lab report will be a disadvantage to you.