Email Us : sunilkumark11@gmail.com
Free Training > SQL PL / SQL Forms Reports Oracle Applications
< Previous Next >

 
Reports - Creating first report using wizard

Let us learn how to create a report using wizard.
Lets us learn the first example to develop the report based on EMP table.

Open the report builder toolWelcome to the Report Builder Select Use the report wizard OK   Welcome to the report wizard Next Create both Web and Paper Layout Next
Title -- EMP Details  , Choose the report style as Tabular Next SQL Query Next arrow  Data Source Definition --  Select * from emp Next provide the username, password and database details Connect Move all the fields from Available Fields to Displayed Fields NextNext Next Select Predefined template -- Blue Next Finish.

This is how your report looks like.

Save the report with the name EMP.rdf

Go to Tools Object Navigator  ( Short cut F5 )
Double click on the Data Model .
Data Model of the report is displayed.

In the data model, we can see the query.

Query results in group.
Group is collection of columns.

In our report, the name of the query is Q_1.
The name of the group is G_EMPNO.
Observer the group contains columns like EMPNO, ENAME, JOB, MGR  etc.

Double click on query Q_1 ,  the query used in developing the report is displayed.

 

In the Object Navigator, when we expand the Data Model, we can see the Query, Group and list of the columns in the group.

 

In the Object Navigator, expand the Paper Layout.
It contains three sections.
1) Header Section
2) Main Section
3) Trailer Section

Expand the Header Section, there is nothing found.
Expand the Trailer Section, there is nothing found.
Expand the Main section, We can see Body and Margin.
Expand Body, we will find M_G_EMPNO_GRPFR. It is called as Group Frame.
It groups all the objects belong the query. Hence it is called Group Frame. It is the first frame that is created by the wizard. The name of the frame always ends with GRPFR ( stands for Group Frame ).

Under Group frame we find Header frame.
This frame name ends with _HDR.
This frame is used to group the column headings of the report.

The next object is repeating frame. We can identify the repeating frame in two ways.
Repeating  always have an arrow on the frame.
The name of the repeating frame always starts with R_
Repeating frame represents a group in the query.
There is one-to-one relationship between group and repeating frame.

The last objects are field objects. These objects reside inside the repeating frame.
Field objects display database columns. The field names start with F_ . The fields must be displayed in the repeating frame that corresponds to the group they are in.
When we are creating the layout manually from the scratch we have to be very careful that the fields are placed in the correct repeating frames.

Let us look at another similar example.
Lets us create another report using wizard based on DEPT table

Open the report builder tool
File New Report  Use the report Wizard OK Next Create both Web and Paper Layout Next Title -- Dept Details   Style -- Tabular SQL Query Next
Data Source Definition -- Select * from dept  Next Enter username, password and database details Connect move all fields from Available fields to displayed fields Next Next Next Predefined template  -- Green Next Finish

This is how our report looks like.

Save the report with the name DEPT.rdf
Similar to our previous example, in the Object Navigator ( F5) , double click on the Data Model, we find query, query results in group. Group contains fields.

In the Object Navigator, expand paper layout, under main section, we find Group frame, Header frame and Repeating frame.  Repeating frame contains fields. This is same as our previous example.

In the Object Navigator,  select Paper Layout,  Go to Tools Report Editor, we get the paper layout of the report. This layout is designed by the wizard.

 Lets us understand the layout designed by the wizard.

Select all the fields ( ctrl + A ) move the layout to the centre by using arrow keys in the keyboard.

Click on any field and select the outer most frame by clicking "select parent frame"  button ( two times)
Expand outermost frame to all the directions by using mouse.

Select column heading loc , select its parent frame by clicking "Select parent frame" button.
Click on Flex Off button.
Move the header frame towards up (by using arrow keys ).

Click on LOC field, select its parent frame and expand to all directions by using mouse.

Select LOC field and move the field towards right by using arrow key.
Select DEPTNO field and move the field towards left by using arrow key.

By looking at the above layout, we can understand arrangement of frames done by the wizard.
All the fields in the repeating frame will be repeated for every row  in the query.
The changes which we have done to the layout is just for our understanding purpose.
Save the changes ( File Save )
Run the report  ( Program Run Paper Layout )

Look at the output below

In the output, we see big distance between the records.  Because in the layout the width of the repeating frame is more.
Let us decrease the width of the repeating frame in the paper layout.

Save the report.
Run the report.

Look at the output below

Observe, there is noticeable distance between the rows now.

 


< Previous Next >