Sunteți pe pagina 1din 157

1

Oracle Applications
Technical Consultant

Prepared By,
N.S.Anjaneyulu
2

1. Develop the report through wizard:

Double click on report builder which is on desktop.

Select the “Use the report wizard”.


Click on ok
3

Click on next.
4

Give the title: “USER'S DETAILS REPORT”


Click on next.
5

Select SQL statement and click on next.


6

Write the SQL query,


>SELECT USER_ID, USER_NAME, CREATION_DATE
FROM FND_USER

Click on next.
7

Give the user name: APPS


Password: APPS
Database: VIS
Click on connect.
8

Transfer the available field’s to the displayed fields


Click on next.
9

Click on next.
10

Click on next.
11

Click on next.
12

Click on finish.
13

This is the output of the report.

*****END OF THE EXAMPLE*****


14

2.Develop the report through manually:

Double click on report builder which is on desktop.

Select the “Build a new report manually”.


Click on ok.
15

Click on the SQL button which is on the left side.

Write the SQL query,


 SELECT USER_ID,USER_NAME,CREATION_DATE
FROM FND_USER

Click on ok.
16

Give the user name: APPS


Password: APPS
Database: VIS
Click on connect.
17

This is “DATA MODEL”.

Go to Layout model from the top of the menu bar.


Click on edit margin and adjust the layout margin.
Again click on edit margin button.
18

Design like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double Click on the repeating frame,
>Source: G_User_id
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the user_id field and give the source: “User_id”.
Double click on the user name field and give the
Source: “User name”.
Double click on the creation date field and give the source:
“creation date”.
19

Click on the run button.

This is the output of the report.

*****END OF THE EXAMPLE*****


20

3.Attaching Logo to this report:

Double click on report builder which is on desktop.

Select the “Build a new report manually”.


Click on ok.
21

Click on the SQL button which is on the left side.

Write the SQL query,


 SELECT USER_ID,USER_NAME,CREATION_DATE
FROM FND_USER

Click on ok.
22

Give the user name: APPS


Password: APPS
Database: VIS
Click on connect.
23

This is “DATA MODEL”.

Go to Layout model from the top of the menu bar.


Click on edit margin and adjust the layout margin.
Again click on edit margin button.
24

Design like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double Click on the repeating frame,
>Source: G_User_id
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the user_id field and give the source: “User_id”.
Double click on the user name field and give the source: “User
name”.
Double click on the creation date field and give the source:
“creation date”.
25

Then after go to start button in the desktop.


Select search.
Files or folders.
All or part of the filename
*.BMP
Click on search
Select any one of the picture right click on that and click on
copy.
Paste on the desktop or any local disk
Select layout model button from menu bar.
Select OLE2 (Object Linking Embedding) from left side and
placed on the with in the frame or with in the repeating frame.
26

Click on “create from file” button.


27

Click on browse button.


28

Select the desktop or localdisk (Before copy the picture).


Select the picture and click on ok.
Click on ok.
29

After Go to layout model automatically displayed like this,


(Adjust The Picture).
For example it will display.
30

Run The Report.

This is output format.

*****END OF THE EXAMPLE*****


31

4.Attaching list of values to the parameters:

Double click on the report builder on the desktop.

Select the “Build a new report manually”


Click on ok.
32

Select the SQL button and write the following query,

SQL query is
>SELECT EMPNO, ENAME, SALJOB, DEPTNO FROM EMP
Where deptno= :p1
Click on ok.
33

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
34

This is “Data Model”.


35

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the job field and give the source: Job
36

Double click on the deptno field and give the source: Deptno
Then after press f3
Select “user parameter” and press f4
Data type: Number
Click on list of values,
Select the “select statement”.

Write the query,


>SELECT DISTINCT DEPTNO FROM EMP
Click on ok.
37

Run the report,


38

This is output format.

*****END OF THE REPORT*****


39

5.Develop the report After select clause:

Double click on the report builder on the desktop.

Select the “Build a new report manually”.


Click on ok.
40

Press f3.
Select the “user parameter” and name is “P_EMPNO_SAL”.

Data type: character


Initial Value: EMPNO, SAL
41

Go to data model and select the SQL button and


Write the SQL query,
>SELECT &P_EMPNO_SAL, ENAME, JOB, DEPTNO
FROM EMP
Click on ok.
Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
42

Double click on the repeating frame,


>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the job field and give the source: Job
Double click on the deptno field and give the source: Deptno
43

Run the report,


44

This is output format.

*****END OF THE REPORT*****


45

6.Develop the report After from clause:

Double click on the report builder on the desktop.

Select the “Build a new report manually”


Click on ok.
46

Select the SQL button and write the SQL query,


>SELECT EMPNO, ENAME, JOB, SAL, DEPTNO FROM
EMP &E

Click on ok.
47

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
48

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the job field and give the source: Job
49

Double click on the deptno field and give the source: Deptno
Run the report,

Enter the: “WHERE DEPTNO BETWEEN 20 AND 30”


Press enter key.
50

This is output format.

*****END OF THE EXAMPLE*****


51

7.Develop the report after where clause:

Double click on the report builder on the desktop.

Select the “Build a new report manually”


Click on ok.
52

Select the SQL button and write the SQL query,


>SELECT EMPNO, ENAME, SAL, DNAME, EMP.DEPTNO
FROM EMP, DEPT
WHERE EMP.DEPTNO= DEPT.DEPTNO (+)
&P_WHERE

Click on ok.
53

Designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
54

Double click on the dname field and give the source: Dname
Double click on the deptno field and give the source: Deptno
After press f3
 Click on user parameters and give the name is
P_FROM_DEPTNO.
Again click on user parameters and give the name is
P_TO_DEPTNO.
Select the report triggers
Double click on the after parameter form and write the following
code,

Function afterpform return Boolean is


Begin
If (:p_from_deptno>50 or: p_to_deptno>50) then
srw.message (5678,'Please enter below 50');
Raise srw.program_abort;
End if;
If (:p_from_deptno is null) then
: p_where:='and emp.deptno<=:p_to_deptno';
End if;
If (:p_to_deptno is null) then
: p_where:='and emp.deptno>=:p_from_deptno';
End if;
If (:p_from_deptno is null and: p_to_deptno is null) then
: p_where:=null;
End if;
If (:p_from_deptno is not null and: p_to_deptno is not null) then
: p_where:='and emp.deptno between: p_from_deptno and
: p_to_deptno';
End if;
Return (TRUE);
End;
55

Run the report,


56

This is the output format.

*****END OF THE REPORT*****


57

8.Develop the report through SQL Messages:

Double click on the report builder on the desktop.

Select the build a new report manually.


Click on ok.
58

Select the SQL button and write the query,


 SELECT EMPNO, ENAME, SAL, JOB, DEPTNO FROM
EMP WHERE DEPTNO=:P_DEPTNO

Click on ok.
59

Give the user name: SCOTT


Password: Tiger
Database: VIS
Click on connect
60

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
61

Double click on the job field and give the source: job
Double click on the deptno field and give the source: Deptno
Press f3
Click on report trigger
Double click on the before parameter form and write the
following code,
Function beforepform return Boolean is
Begin
srw.message (10,'Before parameter form trigger is firing');
Return (TRUE);
End;

 Double click on the after parameter form and write the


following code,
Function afterpform return Boolean is
Begin
srw.message (20,'After parameter form trigger is firing');
Return (TRUE);
End;

 Double click on the before report trigger and write the


following code,
Function before report return Boolean is
Begin
srw.message (30,'Before report trigger is firing');
Return (TRUE);
End;

 Double click on the between pages trigger and write the


following code,
Function between page return Boolean is
Begin
srw.message (40,'Between pages trigger is firing');
Return (TRUE);
End;
62

 Double click on the after report trigger and write the following
code,
Function after report return Boolean is
Begin
srw.message (50,'After report trigger is firing');
Return (TRUE);
End;
63

Run the Report,

Before Parameter Form Is Firing And Click On Ok.


64

Give The Deptno And Press Enter Key.


65

After Parameter Form Is Firing And Click On Ok.


66

Between Pages Report Is Firing And Click On Ok.


67

This Is Final Output Format.

*****END OF THE EXAMPLE*****


68

9.Develop the report through SRW.DO_SQL:

Double click on the report builder which is on desktop.

Select the “Build a new report manually”


Click on ok.
69

Click on the SQL button and write the SQL query,


>SELECT EMPNO, ENAME, JOB, SAL, DEPTNO FROM
EMP WHERE DEPTNO=:P_DEPTNO

Click on ok.
70

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
71

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the job field and give the source: job
Double click on the deptno field and give the source: Deptno
72

Press f3.
Co to report trigger
Double click on the before parameter form and write the
following code,
Function before Form return Boolean is
Begin
srw.message (10,'Enter the deptno');
Return (TRUE);
End;

 Double click on the after parameter form and write the


following code,
Function after Form return Boolean is
Begin
If: P_DEPTNO not in (10, 20, 30) then
srw.message (12,'Invalid Deptno');
Return (false);
Else
Return (TRUE);
End if;
End;

 Double click on the before report and write the following code,
Function before Report return Boolean is
Begin
srw.do_sql ('create table employee2 as select *from TEMP');
srw.message (13,'Table Created Successfully');
Return (TRUE);
End;
73

Run the report,

Enter deptno and click on ok.


74

Give the P_Deptno: 20


75

Table created successfully and click on ok.


76

This is output format.

*****END OF THE REPORT*****


77

10.Develop the report through system parameters:

Double click on the report builder which is on the desktop.

Select the “Build a new report manually”


Click on ok.
78

Click on SQL button and write the SQL query,


>SELECT EMPNO, ENAME, SAL, JOB, DEPTNO FROM
EMP

Click on ok.
79

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
80

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the job field and give the source: job
81

Double click on the deptno field and give the source: Deptno
Press f3
Click on system parameters

Double click on DESFORMAT


Initial value is: DELIMITED
Double click on DESNAME
Initial value is: F:\ANJI\Employee_Details.Txt Or
F:\ANJI\Employee_Details.Doc Or
F:\ANJI\Employee_Details.Xls
Double click on DESTYPE
Initial value is: File
Double click on MODE
Initial Value is: Character
Double click on Orientation
Initial value is: LANDSCAPE Or
PORTAIT
Double click on PRINT JOB
Initial value is: No

Here We Can Run the Report


Then After Go to Path Check It.

*****END OF THE EXAMPLE*****


82

11.Develop the report master details report:

Double click on the report builder on the desktop.

Select the “Build a new report manually”


Click on ok.
83

Click on SQL button and write the SQL query,

SQL query is,


>SELECT *FROM EMP
Click on ok.
84

Again Lick on SQL button and write the SQL query is,
>SELECT *FROM DEPT

Click on ok.
85

Again Lick on SQL button and write the SQL query is,
>SELECT *FROM CUST

Click on ok.
86

Click on the data link button and given the following link
between the EMP and dept tables
EMP.DEPTNO=DEPT.DEPTNO
Then automatically system will be generated the dept table with
deptno1 column.
Again click on the data link button and given the following link
between the dept and cust tables
DEPT.DEPTNO=CUST.CUSTDEPT
87

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
88

Double click on the repeating frame,


>Source: G_Deptno1
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the dname field and give the source: Dname
Double click on the loc field and give the source: Loc
Double click on the deptno field and give the source: Deptno

Double click on the repeating frame,


>Source: G_Custid
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the custname field and give the source:
Custname
Double click on the custdept field and give the source: Custdept
89

Run the report,

This is output format.

*****END OF THE EXAMPLE*****


90

12.Develop the report through summary column:

Double click on report which is on desktop.

Select the “Build a new report manually”


Click on ok.
91

Select the SQL button and write the SQL query,

SQL query is,


>SELECT EMPNO, ENAME, SAL, DEPTNO FROM EMP
WHERE DEPTNO=:P_DEPTNO
Click on ok.
92

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
93

This is Data model.


94

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
95

Go to data model,


Select the summary column button from the left side of the
menu bar and place on the canvas.
96

Double click on the CS-1 field and give the properties,


Source: SAL
Function: SUM
Reset all: REPORT or PAGE
97

Go to layout model


Take the text button then write the “SUM OF SAL” and take the
field button and place on the canvas.
Double click on the Sum of Sal field and give the following
properties,
Source: CS-1
98

Run the report,


99

This is output format.

*****END OF THE EXAMPLE*****


100

13. Develop the report through formula column:

Double click on the report builder which is on desktop,

Select the “Build a new report manually”.


Click on ok.
101

Select the SQL button and write the SQL query,

SQL query is,

SELECT ROWNUM, ENAME, SAL, DEPTNO FROM (SELECT


ROWNUM, ENAME, SAL, DEPTNO FROM EMP ORDER BY
SAL DESC) WHERE ROWNUM<5

Click on ok.
102

Click on connect.
103

This is data model.


104

Select the formula column button from left side of the menu bar
in data model and place on the cursor with in the data model.
105

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Rownum
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the rownum field and give the source: Rownum
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
Double click on the bonus field and give the source: CF-1
106

Go to data model,


Select the CF-1 formula column and right click on the CF-1 and
select the PL/SQL Editor and write the following code,
> Function CF_1Formula return Number is
Bonus number (6);
Begin
If: Sal <=2000 then
Bonus: =: sal+500;
Else
Bonus: =: sal+750;
End if;
Return (bonus);
End;
Then after click on “compile” and “close”.
107

Run the report,

This is output format.

*****END OF THE EXAMPLE*****


108

14. Develop the report through Place Holder


column:

Double click on the report builder which is on desktop.

Select the “Build a new report manually”.


Click on ok.
109

Select the SQL button and write the SQL query,

SQL query is,


>SELECT RPAD (‘ICICI BANK’, ROWNUM)
COMPANY_NAME, EMPNO, ENAME, SAL, DEPTNO FROM
EMP WHERE DEPTNO =:P_DEPTNO ORDER BY ROWNUM
DESC

Click on ok.
110

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
111

This is data model.


112

Select the placeholder button and place on the with in the data
model name is “CP-DNAME”.
Again Select the placeholder button and place on the with in the
data model name is “CP-LOC”.
Select the formula column button and place on the with in the
data model name is “CF-1”.
113

Right click on the CF-1 and select the PL/SQL Editor and write
the following code,
> Function CF_1Formula return Number is
X dept.dname%type;
Y dept.loc%type;
Begin

Select dname, loc into x, y from dept where deptno=:p_deptno;


: cp_dname:=x;
: cp_loc:=y;
Return (0);
End;
Click on “compile” and “close”.
Go to layout model and designing like this,
114

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Company_name
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the c_name field and give the source:
Company name
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
Double click on the dname field and give the source: Dname
Double click on the loc field and give the source: Loc
115

Run the report,


116

This is output format.

*****END OF THE EXAMPLE*****


117

15. Develop the report through Format trigger:

Double click on report builder which is on the desktop.

Select the “Build a new report manually”.


Click on ok.
118

Click on the SQL button from the left side of the menu bar and
write the SQL query,

SQL query is,


>SELECT EMPNO, ENAME, SAL, DEPTNO FROM EMP
WHERE DEPTNO=:P_DEPTNO
Click on ok.
119

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
120

This is data model.


121

Select the summary column button and place on the outside of


the data model.

Double click on the summary column field and give for the
properties,

Function: COUNT
Source: EMPNO
122

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
123

Select the text button and write the following text,

*****NO DATA FOUND*****


124

Select the text item and right click on that and select the PL/SQL
Editor and write the following code,

>Function B_5FormatTrigger return Boolean is


Begin
If: CS_1=0 then
Return (TRUE);
Else
Return (false);
End if;
End;

Click on “Compile” and “Close”.

Run the report,


125

I have entered “60”.


126

This is output format.

*****END OF THE EXAMPLE*****


127

16. Develop the report through conditional format


trigger:

Double click on the report builder which is on desktop.

Select the “Build a new report manually.


Click on ok.
128

Click on the SQL button and write the SQL query,

SQL query is,


>SELECT EMPNO, ENAME, SAL, COMM, DEPTNO FROM
EMP E1 WHERE NOT EXISTS (SELECT EMPNO, ENAME,
SAL, COMM, DEPTNO FROM EMP E2 WHERE
E1.DEPTNO=E2.DEPTNO
HAVING COUNT (E2.ENAME)>5)
ORDER BY DEPTNO, ENAME
Click on ok.
129

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
130

This is data model.


131

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the comm field and give the source: Comm
Double click on the deptno field and give the source: Deptno
132

Right click on the empno field and write the following code,

>Function F_1FormatTrigger return Boolean is


Begin
If (: empno>=7700) then
srw.set_text_color ('red');
End if;
Return (true);
End;
Click on compile and close.

Right click on the Sal field and write the following code,
>Function F_1FormatTrigger return Boolean is
Begin
If (: Sal>2000) then
srw.set_text_color ('blue');
srw.set_font_face ('courier new');
srw.set_font_size (16);
srw.set_font_weight (srw.bold_weight);
srw.set_font_style (srw.plain_style);
End if;
Return (true);
End;
133

Run the report,

This is output format.

*****END OF THE EXAMPLE*****


134

17.Develop the report through Multiple Layouts:

Double click on report builder which is on desktop.

Select the “Build a new report manually”


Click on ok.
135

Click on SQL button and write the SQL query,

SQL query is,


>SELECT EMPNO, ENAME, SAL, DEPTNO FROM EMP

Click on ok.
136

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
137

This is data model.


138

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
139

Go to data model from the menu bar.


Click on SQL button and write SQL query,

SQL query is,


>SELECT DNAME, LOC, DEPTNO FROM DEPT
Click on ok.
140

This is data model.


141

Go to layout model


Select the “Additional Default Layout” button from the left side
menu bar.

Click on next.
142

Transfer the data from,


Available field to Displayed field
G_Empno G_Dname
Used on the “Down >” this button.
Click on next.
 Transfer the data from,
Available field to Displayed field
Empno Deptno1
Ename Dname
Sal Loc
Deptno
Click on next.
Click on next.
Click on finish.
Automatically it will display for layout model.
143

Press f4.
Select the user parameter and from left side (+) this symbol is
enabled automatically click on that + symbol and name is,
P_TABLENAME
Double click on the P_TABLENAME and give the properties,
Data type: Character
Select the parent frame of EMP layout
Place cursor between two fields of EMP layout.
Press f4.
Go to format trigger and double click on that and write the
following code,
> Function R_1FormatTrigger return Boolean is
Begin
If: P_TABLENAME='EMP' then
Return (TRUE);
Else
Return (false);
End if;
End;

Select the parent frame of DEPT layout


Place cursor between two fields of DEPT layout.
Press f4.
Go to format trigger and double click on that and write the
following code,
> Function R_G_DNAMEFormatTrigger return Boolean is
Begin
If: P_TABLENAME='DEPT' then
Return (TRUE);
Else
Return (false);
End if;
End;
144

Run the report,

I have given “DEPT”.


145

This is output format.

*****END OF THE EXAMPLE*****


146

18. Develop the report through calling from one


report to another report:

Double click on the report builder which is on the desktop.

Select the “Build a new report manually”.


Click on ok.
147

Select the SQL button and write the SQL query.

SQL query is,


>SELECT EMPNO, ENAME, DEPTNO, HIREDATE, SAL,
CASE
WHEN (SAL<1000) THEN 'SUPERVISOR',
WHEN (SAL<2000) THEN 'ASSISTENT MANAGER',
WHEN (SAL<3000) THEN 'CLERKS',
WHEN (SAL<5100) THEN 'MANAGER',
ELSE
'MANAGING DIRECTOR'
END RESULT_SET FROM EMP
WHERE DEPTNO=:P_DEPTNO

Click on ok.
148

Give the user name: SCOTT


Password: TIGER
Data base: VIS
Click on connect.
149

This is data model.


150

Go to layout model and designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Empno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the empno field and give the source: Empno
Double click on the ename field and give the source: Ename
Double click on the Sal field and give the source: Sal
Double click on the deptno field and give the source: Deptno
Double click on the hire date field and give the source: Hire date
Double click on the result set field and give the source: Result
set
151

Then after save the report in any local disk or desktop and close
the report.

Double click on the report builder which is on desktop.

Select the “Build a new report manually”.


Click on ok.
152

Click on SQL button and write the SQL query,

SQL query is,


>SELECT DEPTNO, DNAME,
DECODE (DEPTNO, 10,'20% HIKE',
20,'15% HIKE',
30,'10% HIKE') BONUS
FROM DEPT

Click on ok.
153

Give the user name: SCOTT


Password: TIGER
Database: VIS
Click on connect.
154

Go to layout model designing like this,

Give the properties,


Double click on the frame,
>Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the repeating frame,
>Source: G_Deptno
Vertical Elasticity: Expand
Horizontal Elasticity: Variable
Double click on the deptno field and give the source: Deptno
Double click on the dname field and give the source: Dname
Double click on the bonus field and give the source: Bonus
155

Select the “BUTTON” from left side of the menu bar in layout
model and adjust the layout and place the button inside the
repeating frame like this,

Double click on the button and give the properties,


>Text: EMP
Type: PL/SQL
Right click on this button and select PL/SQL Editor and write
the following code,
Procedure U_1ButtonAction is
Begin
srw.run_report ('F: \Called_Report.rdf P_DEPTNO='||: deptno);
End;
Click on compile and close.
156

In layout model Go to view and click on Runtime Preview.


It will display automatically,

I have click the deptno=10 button.


157

Click on any on of the button field,

This is output format.

*****END OF THE EXAMPLE*****

S-ar putea să vă placă și