Home » Developer & Programmer » Reports & Discoverer » getting parameters from formula (oracle 10g R2, Windows7)
getting parameters from formula [message #547926] Mon, 19 March 2012 01:14 Go to next message
7anona
Messages: 72
Registered: February 2012
Member
Hello every one,
I'm a beginner in building report. I'm using a tabular kind of report. I've made about 4 formula (function)columns in mey report. I want to make a calculation columns which will get parameters from values returned by these functions
please respond as soon as possible
thanks
Re: getting parameters from formula [message #547930 is a reply to message #547926] Mon, 19 March 2012 01:51 Go to previous messageGo to next message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Post a working Test case.
Re: getting parameters from formula [message #547950 is a reply to message #547930] Mon, 19 March 2012 03:18 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Formula columns (as any other columns) can be referenced by their name, preceded with a colon (:) sign.

For example, if there are CF_1 and CF_2 formula columns, and you want to sum them in CF_3, you'd do that by
function cf_3 return number
is
  retval number;
begin
  retval := :CF_1 + :CF_2;
  return (retval);
end;

If that's not what you are asking, I guess you'll say so.

[Updated on: Mon, 19 March 2012 03:18]

Report message to a moderator

Re: getting parameters from formula [message #547956 is a reply to message #547930] Mon, 19 March 2012 03:34 Go to previous messageGo to next message
7anona
Messages: 72
Registered: February 2012
Member
I have 7 items in my report
(4 items are from tables )
-code
-item2
-item3
-item4

5th item is a formula:

function item5 return Number is

x number;
begin

select sum(a.QUANTITY) into x
from child_table a,parent_table b
where a.FK = b.PK
and a.FK2 = :code


return(X);

end;


6th item is a formula:
function item6 return Number is

y number;
begin

select sum(a.QUANTITY) into y
from child_table2 a,parent_table2 b
where a.FK = b.PK
and a.fk2 = :code


return(y);
end;

7th item is item3+item5-item6

all the functions work fine and the results in the report are accurate for the first 6 items, how can I get the 7th item ?
Re: getting parameters from formula [message #547958 is a reply to message #547956] Mon, 19 March 2012 03:39 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
return (:item3 + :item5 - :item6);
Re: getting parameters from formula [message #547959 is a reply to message #547956] Mon, 19 March 2012 03:55 Go to previous message
7anona
Messages: 72
Registered: February 2012
Member
thanks it worked Smile
Previous Topic: REP-1108- increase layout defult
Next Topic: Oracle apps Data does not show in Discoverer
Goto Forum:
  


Current Time: Sat Nov 30 06:39:57 CST 2024