Rep 06 -31 Format Trigger

6
9/2/13 Rep| 06| -31 Format Trigger newtonapples.com/oracle-reports-format-trigger/ 2/9 ……………………………………………………………………………….. See other relevant topics No relevant added yet. Give us sometime to get this right! Format Trigger:-Format trigger is noting but displaying the output dynamically based on condition. By using this we can hide or display the data based on condition. It returns Boolean For that we are going to create report based on ‘EMP’ that, if ‘SAL’ is less than 1500 then that employees salary need not to display else to display the employees with their salary which will shown step by step process.

description

Rep 06 -31 Format Trigger

Transcript of Rep 06 -31 Format Trigger

Page 1: Rep 06 -31 Format Trigger

9/2/13 Rep|06| -31 Format Trigger

newtonapples.com/oracle-reports-format-trigger/ 2/9

………………………………………………………………………………..

See other relevant topics

No relevant added yet. Give us sometime to get this right!

Format Trigger:-Format trigger is noting but displaying the output dynamically based on condition.

By using this we can hide or display the data based on condition.

It returns Boolean

For that we are going to create report based on ‘EMP’ that, if ‘SAL’ is less than 1500 then that employeessalary need not to display else to display the employees with their salary which will shown step by stepprocess.

Page 2: Rep 06 -31 Format Trigger

9/2/13 Rep|06| -31 Format Trigger

newtonapples.com/oracle-reports-format-trigger/ 3/9

Here we are going to create report manually by using below query

SELECT empno,

Ename,

Sal,

Deptno,

Hiredate

From emp;

We already know how to build report manually.

So, for our purpose we are showing only data model and its layout which is shown below.

Its layout

Page 3: Rep 06 -31 Format Trigger

9/2/13 Rep|06| -31 Format Trigger

newtonapples.com/oracle-reports-format-trigger/ 4/9

Here we are going to write piece of code in the ‘SAL’ column.

For that give right click on ‘SAL’ field and in that select ‘PL/SQL Editor’ which is shown below

Page 4: Rep 06 -31 Format Trigger

9/2/13 Rep|06| -31 Format Trigger

newtonapples.com/oracle-reports-format-trigger/ 5/9

Now we will get below window. There we have to write condition.

Here we want to display the employees whose salary is greater than 1500.

According to that we have to write PL/SQL code shown below.

Page 5: Rep 06 -31 Format Trigger

9/2/13 Rep|06| -31 Format Trigger

newtonapples.com/oracle-reports-format-trigger/ 6/9

Now we are executing the report

Before that one’s we will the employees whose salary is less than 1500.

For that

SELECT * FROM emp;

From the above output we can say that employees with empno 7654, 7844, 7900,7744,7746,7747whose salary is less than or equal to 1500.

According to our report the employees whose salary is less than or equal to 1500 those employees salaryneed not to display.

Lets check.

Execute the Report

We get the output shown below

Page 6: Rep 06 -31 Format Trigger

9/2/13 Rep|06| -31 Format Trigger

newtonapples.com/oracle-reports-format-trigger/ 7/9

Here we can see that the employees whose salary is less than or equal to 1500 , those employees salary isdidn’t displayed.

This can be achieved by using format trigger which is nothing but dynamically displaying the data based onthe condition

<< Report Triggers And Their Sequence

Report Registration>>

This post has been viewed 1764 times

About the Author: Venkat

(15 votes, average: 5.00 out of 5)

Loading ...

Disclaimer: Contents expressed in this post are viewpoints of independent authors/contributors and are not reviewed for correctness or accuracy by