Creating a data link Creating or editing a formula column

How To... 4-57

4.8.9 Creating a data link

To create a data link:

1. In the Data Model view, single-click the Data Link tool in the tool palette. A link is

always drawn from the parent group to the child query.

2. Create the link:

Create a Group to Group Link: To create a link between one querys group and another querys group, which is useful when you want the child query to know about the parents data, click the parent group avoiding the columns in the group and drag a link to the child group. Create a Column to Column Link: To create a link between columns, click a column of the parent query and drag a link to a column of the child query.

3. Double-click the new link object to display the Property Inspector, and set the

desired properties. See also Section 1.7.4, About data links Section 2.3.5, About non-linkable queries

4.8.10 Creating or editing a formula column

To create or edit a formula column: 1. In the Data Model view, single-click the Formula Column in the tool palette, then: ■ To create a column within a group, click in the group at the position you want the column placed in the hierarchy. ■ To create a report-level column, click in an open area of the canvas region. 2. Double-click the formula column object to display the Property Inspector.

3. Under the PlaceholderFormula node, double click the PLSQL Formula property

field. 4. In the PLSQL Editor, define the PLSQL for the formula for example SAL 0.07. Example: Referencing a PLSQL function in formulas Suppose that you have a report with the following groups and columns: Groups Columns Summary --------------------------------------- RGN REGION RGNSUMSAL SUMDEPTSUMSAL COSTOFLIVING DEPT DNAME DEPTNO DEPTSUMSAL SUMEMP.SAL JOB JOB HEADCOUNT COUNTEMP.EMPNO EMP ENAME EMPNO SAL COMM 4-58 Oracle Reports Users Guide to Building Reports Given these groups and columns, you might create multiple formulas that apply the cost of living factor COSTOFLIVING to salaries. To avoid duplication of effort, you could create the following PLSQL function and reference it from the formulas: function CompSalsalary number return number is begin return salaryCostofLiving; end; Following are some examples of how you might reference the PLSQL function in formulas: CompSal:RGNSUMSAL or CompSal:SAL + COMM See also Section 2.3.2, About formula columns

4.8.11 Creating a summary column