Reports 10g Nag

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 89

Reports 10g

Development of Report through wizard

Double click on Report Builder which is on Desk Top

Click on ok to develop the report through wizard(Here Report


output format will be generated by system itself).
Click on Next
Click on Next
Enter Title is Employee Details and Click on Next
Click on Next

Select Connect Button


Enter the above Details
Click on Connect and Next
Trasfer required fields from available fields to displayed fields
Click on Next
Click on Next
Click on Next
Click on Next

Click on Finish.

The output will be generated as below format. Here all fields


were selected so that output has been generated for all fields.
Note:-

If we want to see the Data Model , selct Data Model button from
top of the menu bar
Similarly If we want to see the Layout Model,selct Layout
Modle button from top of the menu bar
Similarly If we want to see the Object Navigator press F5 to see
the objects which are created.
Development of Report through Manually

Double Click on Report Builder which is on desk top.

Select a button called build new report manually

Click on Ok.
Click on SQL Query button from left side the menu
bar
Agin click on Right side of the canvas

Write a following statement in the sql query statement.


Click on Connect Button.
Give User Name is apps
Pass word is apps
Data Base is vis
Click on Connect Button.
Click on OK Button.
The data model will be create like below shape.
Agin Click on Paper Layout from top of the Menu
Bar.
Go to Tools Menu from top of the Menu bar.
ToolsOptionsRulers
Select Character cells and click on ok.
Select Frame from left side the menu bar and drag as
mention below screen shot.
Take Repeating Frame and Fields and Text(Used
to display wording) with in the frame as designed below.

Repeat
Fields Text
Frame ing
Frame
Select Frame press F4. set the properties as below
mentioned.

Similarly select the Repeating Frame and press


F4.set the properties as below mentioned.

Note: - The Above source is setted based on the data

modele group name.

Double click on fileds and set the each field with


different column names.
Sorce=JO
Source=EMPNO Source=ENAME Source=S Source=D B
AL EPTNO

Go to Program Select Run paper Layout.


Example for Bind Parameter:-
-------------------------------------

Open the Report builder


Develop the report using below statement.
Click on Ok.
Enter the user name ,password and database
Click on Connect
Click on Ok.;

Design the layout as per below process


The above has been designed for previous report.
Run the Report : ToolsRun the paper layout and enter the
values and see the output.

Lexical Parameter.
-----------------------

Double click on report builder which is on desktop

Select build report manually


Click on Ok.
Press F5 for Object Navigator.

Click on this + button


Click on Obove + button

Select User parameters and Click on +(Green color) object.


Green color object

It displays below like this


Press (F4) or (Double click) on P_1
Set the following below properties

Close the child window.


Child window

Doble click on Below data model object


Data model object

Select SQL Query button from left side the menu bar.
Drop on the canvas and write the below statement as it is.
Click on Ok button.
Give the username,pass word ,data base details as below
mentioned.

Click on connect.
click on Paper layout button from top of the menu bar
Goto toolsoptionsRulersChatector cells ok
Design the layout as per previous report designment.
Run the Report to see the output.
Example 2 For Lexical Parameter(Using ofter from clause)
-------------------------------------------

Develop the Report using


Select empno,ename,sal,deptno from emp &E;
Design the layout and pass the where condition in the
parameter window.

System Parameters
--------------------
System Parameters are used to transfer report
output to the client location or corporate office location.

Open the Report builder which is on desktop


-

Select a button called build a new report manually.


Select SQL Query button from left side the menu bar.
And write following select Statement and enter the
username,pass word ,data base and click on connect and ok.
Click on paper layout from top of the menu bar.

ToolsoptionsRulersChracteres.
Design the layout as below mentioned.

Press F5 For object Navigator.


Select System parameters

Double Click on DESFORMAT .Give the initial value is


DELIMITED.
Double Click on DESNAME .Give the initial value is
C:\EMP_DATAILS.xls
Double Click on DESTYPE .Give the initial value is
File..
Double Click on MODE .Give the initial value is
Charectors..
Double Click on ORIENTATION .Give the initial value is
Landscap.
Double Click on PRINTJOB .Give the initial value is
YES..

Go to programRun the paper layout.


See the output file in C:\EMP_DATAILS.xls

Adding the List of values to the Report


--------------------------------------

This process is to be done to our previous report


Modify the above select statement as per below mentioned.

Select userparameters

Double click on P_DEPTNO


Select List of values and write the following query and click on
ok.and close the child window.
Run the Report
Master Details Report
------------------------------------

Master detail report is used to get the related records between


two tables.
Here Data Link is used to give link between two data base
tables.

Double click on Report Builder which is on Desktop

Select a button called build a new report Manually

Click on Ok.
Select SQL Query button from left side the menu bar and place
it in canvas
Write a following statement and click on connect button
click on ok.
Similary select SQL Query button from left side the menu bar
and place it in data model.

Click on Ok.
Select Data link from left side the menu bar.
Drag deptno to deptno columns of two data models.
Click on paper Layout from top of the menu bar.
Go to Tools optionsRulers
Select character cell and click on ok.
Design the layout as mentioned below.

Adding one more data model to above report.


select paper Layout from top of the menu bar.

Design as below mentioned.


Report Triggers
-----------------

Develop the Report through wizard using Select * from emp


where deptno=:p_deptno

Press F5 for object Navigator


Select report triggers
Double click on BEFORE PARAMETER FROM


Click on Compile and close.

Double click on After parameter form

Complie and close.

Double click on Befor report trigger.


Double click on Between pages

Double click on After Report


Compile and close.
save and run the report.

SRW.DO_SQL
----------------- Used to perform DDL Operations.

Develop the report through wizard using


SELECT * FROM EMP WHERE DEPTNO=:P_DEPTNO;
After displaying report out put ,press f5 for object navigator
select datamodelselect report triggers
Double click on before parameter form
Compilie and close.
Double click on after parameter form.

Double click on befor report

Double click on between pages


Double click on after report

Go to programs complieall
Go to programsRun paper layout to see the firing status.

Format Trigger
---------------------
Format Trigger is used to displays the object and hide the object

Develop the Report using SELECT EMPNO, ENAME, SAL,


DEPTNO FROM EMP WHERE DEPTNO=:P_DEPTNO;

Select summary Column from Left side the menu bar and
place into canvas

Double Click on Summary Column(cs_1);


Set the below properties.

Click on Paper Layout From top of the Menu Bar.


Design the Layout as below mentioned.
Take one more TEXT from left side the Menu bar and put it
into layout as mentioned below.write meesage is *****NO DATA
FOUND******;

Right Click on TEXT item Select PL/SQL Editor.


Write Below Syntax.
Click on Complie button and close.

Complie ctrl+shift+k;
Run the Report;

Enter the invalid deptno 50 see the output.


Similarly take one more TEXT item for End of the Report
Right click on text item and select pl/sql editorwrite the
following code.
Compile and close and see the output.
RUN THE REPORT to see the output.

Multi Layout Report


-----------------------

Double click on Report Builder which is on desktop

Select Build New Report Manually

Click on ok.
SELECT SQL Query button from left side the menu bar.
Write below statement.

Again Select SQL Query Button from left side the menu bar.

Click on Ok.
Press F5 for Object Navigator.
Select User parameter
Click on +(Green color) from left side the menu bar.

Press F4 on P_1 Parameter.

Give the below name or any name and DATA TYPE and
WIDTH as mentioned below.

Double click on paper layout in the object Navigator.

Set the Character cell prpeties


Click on ok.
Deisign layout as mentioned below.

Right click on EMP Layout FRAMEand select PL/SQL


Editor write following code.

Complie and close.

Select DEPT LAYOUT FRAME and Right click on this and


select PL/SQL Editor

Complie and close.


Go to programs Run paper Layout.

See the output.


You can see only employee layout.if you enter DEPT_DETAILS
you can see dept layout only
Conditional Format Trigger
--------------------------------

Develop the report using SELECT


EMPNO,ENAME,SAL,DEPTNO,JOB FROM EMP;
Design the layout as below metioned.

Roght Click on EMPNO field;


Write the below condition
Right click on SALField ,SELECT PL/SQL EDITOR.

Compile and close.
Run the Report to see the output.
Displaying the logos in the report from tables.
------------------------------------------------

Create table as below mentioned.


CREATETABLECUSTOMER_DETAILS
(CUST_NONUMBER(2),
CUST_NAMEVARCHAR2(30),
CUST_PHOTOVARCHAR2(200));
Copythelogosfromstartsearch*.bmp

Putitintoc:Drive

Inserttherecordsintotableasbelowmentioned.

Develop
the Report Using SELECT * FROM
CUSTOMER_DETAILS
Design the Layour as mentioned Below.Similarly set all
fram,repeating frame and field properties.
after that follow the below mentioined navigation.

Select CUST_LOGO (F_3) which is in repeating frame.


Press F4.
Set the below properties.

Run the Report and See the output.

Go to Layout Double click on Repeating frame.


Right click on CUST_LOGO field.select pl/sql editor

Write following code and complie and close and run the report
to see the output.
Run the Report,see the below output .The logo is displayed only in
3 Page.

You might also like