Oracle Reports Tutorial - Place Holder

PLACE HOLDER COLUMN: – Place holder Column is a column which holds the value at runtime.

  

Place Holder Column acts like global variable. We can use Place Holder Column any where in the report one’s we declare. Place Holder Column can be handle in ‘BEFORE REPORT TRIGGER’. Here our achievement is displaying the deptno dynamically. We can overcome this by using PLACE HOLDER COLUMN We are creating data model manually and layout model by using wizard. So, first create data model as shown below.

Write a query in SQL Query Statement shown below

SELECT * FROM emp WHERE deptno=:p_deptno /*it is bind parameter which holds value*/

Now it will ask for Database Connection. Then provide proper username, password, Database

Click on ‘Connect’ Then it will show message like ‘Query<query name> has created the bind parameter ‘<parameter name>’’ which is shown below

Then Click on ‘OK’

Now place one PLACE HOLDER COLUMN in Report level which is shown below Go to properties of Place Holder Column and provide proper name which is shown below .

Now data model looks like .

Now we are going to handle this Place Holder Column in BEFORE REPORT TRIGGER. Here we just assign the parameter what we had created to the place holder column which we can see in further steps .

First go to object navigator and click on Report triggers which is tree structure which is shown below .

where you are going to assign user parameter to place holder column: .There we can see BEFORE REPORT TRIGGER Now you will get a window as shown below.

Now we are going to create report manually. here we just see layout To that layout which is above we are just adding one field and providing place holder column name as source which is shown below . So. In the previous lessons we already seen that how to create layout manually.

take one filed and provide proper name as shown below For that field we are providing source by giving right click on the filed and select Property Palette which is shown below .So.

Here we will get the property palette of that particular field which is shown below Here we will provide proper name and source .

Now we are going to execute the report.Up to here we completed the creation of data model and lay out model. When ever we execute the report it will ask for a parameter which we can pass dynamically. .

So in the output . Here we are providing deptno 10 as parameter.So provide proper parameter which is shown below Provide proper parameter.

it holds the value at run time and it is nothing but user parameter value. .e.We get the employees who are in the deptno 10 Press ‘ENTER’ Here we can see the output that place holder column displayed the parameter value i.

. Here we are going to know how summary column works if we place at group level So.Summary Column At Parent Group Level Summary Column:-Summary Column is used to calculate aggregate functions.Oracle Reports Tutorial . first create a one data query by using below statement SELECT *FROM dept. We are going to create two data queries in single data model and providing data link between the two data queries which is shown below.

Now create another data query by using below statement SELECT * FROM emp. .

Now data model looks like .

Now create a link between two data queries by using data link .

in group level for calculating department wise total salary which is shown below Now go to properties of Summary Column (CS_DEPT_TOT_SAL) which we had taken and provide below properties like name.Place one summary column in ‘Q_1’ i. reset. Here we are providing Name-CS_DEPT_TOT_SAL Function-Sum Source-Sal Reset At. source. function.G_DEPTNO (at group level) Which is shown below .e.

For that go to data model and give right click on ‘Q_2’ and select ‘Report Wizard’shown below .Now creating layout using wizard method.

Here select ‘Style’ tab and in that select ‘Group above’ Option shown below .

Click on ‘NEXT’ .

Here move those fields which are in Available Field (G_DEPTNO. G_empno) to Displayed Field in ‘Down’ Direction shown below .

Click on ‘NEXT’ Here move all Available fields to Displayed Fields which is shown below .

Here we can see that all available fields moved to Displayed field .

Click on ‘NEXT’ .

Click on ‘NEXT’ .

Click on ‘FINISH’. Here we can see output with department wise total salary .

Summary Columns At Report Level Summary Column:-Summary Column is used to calculate aggregate functions We are going to create two data queries in single data model and providing data link between the two data queries which is shown below. Here we are going to know how summary column works if we place at Report level So. . first create a one data query by using below statement SELECT *FROM dept.

.Now create another data query by using below statement SELECT * FROM emp.

Now data model looks like the following image:- .

Now create a link between two data queries by using data link Place on summary column in Report Level which is shown below .

Now go to properties of Summary Column (CS_TOT_SAL) which we had taken and provide below properties like name. Here we are providing Name-CS_TOT_SAL Function-Sum Source-Sal1 Reset At-Report (at report level) . function. reset. source.

Now create a layout using wizard method. For that go to data model and give right click on ‘Q_2’ and select ‘Report Wizard’ as shown below. Here select ‘Style’ tab and on that select ‘tabular’ which is shown below .

.Click on ‘NEXT’ you will find a window that you would like to display and the direction in which records should repeat.

Here move ‘G_EMPNO’ which is in Available Fields to Displayed Groups in ‘Down’ which is shown below .

.Click on ‘NEXT’ Here we will get all fields present in two Queries which is in data model.

Then move all Available Fields to Displayed Fields Shown below .

Click on ‘NEXT’ Click on ‘NEXT’ and select the template style to display the report: .

Click on ‘FINISH’ to see the report output: .

Here we are going to know usage of FORMULA COLUM Creating a data link between two data queries and providing a data link Creating first data query by using below statement . Formula Columns Formula Column is used to calculate any user defined calculations. So we have known that usage of Summary Column in Report Level.Here we can see the Total Amount Of Salary of All employees.

Creating another data query by using below statement SELECT * FROM emp. .

Now data model looks like .

Create a link between two queries by using data link is shown below. .

Now place one formula column in ‘Q_2’ for calculating NET (sal+comm) for every employee which is shown below .

In that formula column we are going to write piece of PL/SQL code in PL/SQL Formula for calculating NET (SAL+COMM) Amount which is shown below So. go to properties of formula column and provide proper name and write code in PL/SQL Formula which is shown below. .

In this PL/SQL Formula we will write below code Now we are display the data through wizard method. .

For that go to data model . Give right click on ‘Q_2’ and select ‘Report Wizard’ which is shown below. Then we will get below window .

Click on ‘NEXT’ .

Click on ‘NEXT’ and select the report direction: Click on ‘NEXT’ to select the fields to display: .

Click on ‘NEXT’ .

Click on ‘NEXT’ and give some label names if you want to modify: .

Click on ‘NEXT’ .

Click on ‘FINISH’ here we can see the output .

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.