Home » Developer & Programmer » Forms » how get running total in grid
how get running total in grid [message #241292] Tue, 29 May 2007 02:11 Go to next message
mfa786
Messages: 210
Registered: February 2006
Location: karachi
Senior Member
hi master
sir how i get running total in grid
i have four column in my grid
sno,title,total,runningtotal
i need runntotal in lastcolumn
i use in vanvalidate event
:runingtotal := :runingtotal+ :total
but this code not give me right result



such as
sno title total runningtotal
1 dksdl 7 7
2 ghdgd 4 11
3 dgdf 3 14
4 gdfgdf 4 18

i need this type of grid i have

please give me idea

thank's

aamir

Re: how get running total in grid [message #241325 is a reply to message #241292] Tue, 29 May 2007 04:41 Go to previous messageGo to next message
mustaf_82
Messages: 20
Registered: May 2007
Location: UAE
Junior Member
for this thing, you have to take another field and make it a summary column of running_total.
Then on When_Validate trigger, write the following thing;

:running_total:= :total + <Summary Column of Running Total>
Re: how get running total in grid [message #241967 is a reply to message #241292] Thu, 31 May 2007 04:17 Go to previous message
hemavb
Messages: 103
Registered: May 2007
Location: Dubai , UAE
Senior Member
...

Make one form parameter name it p_run_total, type = number.
To access it you have to give use - :parameter.p_run_total
if you are fetching the records in forms from the db, you have to use POST-QUERY trigger at block level.
This trigger would read:
:parameter.p_run_total := NVL(:parameter.p_run_total, 0) + :total;
:running_total := :parameter.p_run_total;


This should do it.
Previous Topic: LOV Problem
Next Topic: On update trigger
Goto Forum:
  


Current Time: Sat Dec 14 00:38:41 CST 2024