Home » Developer & Programmer » Forms » calculating the values
calculating the values Sat, 11 October 2008 10:21
 kommerashashi Messages: 23Registered: November 2007 Junior Member
i have master block and detail block depends on the master block some values are populates for 1 column depends on the join condition

details block and the values

1 1000
2 2540
3 4875
4 547841

total =
here my problem is i have to calculate and sum of all the items which are populated in the detail block
for some other master block we have more than the above data in the detail block .

depends on the data its populating . one time it populates 2 columns ,another time 1 columns .....so here i have to do the sum( displayed data .......how to do that and in which trigger i have to write and can please paste the code .

iam requesting you in advance thanks

[Updated on: Sat, 11 October 2008 10:24]

Report message to a moderator

Re: calculating the values [message #353126 is a reply to message #353110] Sat, 11 October 2008 11:37
 Littlefoot Messages: 21148Registered: June 2005 Location: Croatia, Europe Senior MemberAccount Moderator
Perhaps it is me who is incapable of understanding your question as I'm not sure whether you are talking about rows or columns, but - did you consider using Forms built-in "Calculation" item properties?

Re: calculating the values [message #353133 is a reply to message #353110] Sat, 11 October 2008 14:54
 subba99 Messages: 31Registered: September 2008 Member
follow these steps u can easily got the solution
Method1

)SET Precompute summaries to YES under Advanced database in Property_pallet of Detail-block
2)place one TEXT-ITEM name it as T1 in detail-block and provide prompt as Total,open property pallet of T1
if it a number column set datatype=number,if u won't set datatype as number u get an error

Database item=no
Calculation mode=summary
summary function=sum
summarized block=name of detail-block
summarized-item=name of calculated item in that block
NOTE:1)place T1 item in separate control-block or place T1 in Detail block by providing Query all records =yes in DEtai-block property pallet
3)run the form...............now
The form displays the total vaules in T! field item Based on Relationship condition

Method2

you can do this by proving calculation mode=formula also but u need to write a PL/SQL statement

still if u have any errors contact me

Thanks and regards
---------------------
subbu

[Updated on: Sat, 11 October 2008 14:57]

Report message to a moderator

Re: calculating the values [message #353890 is a reply to message #353126] Wed, 15 October 2008 08:16
 kommerashashi Messages: 23Registered: November 2007 Junior Member
Dear Sir,

actually i want to calculate the cu,alative frequency of each and every row i have to calculate and i have to post into one non data base item.

my requirment is to calculate the cumalative frequency like

row values like :--

10
20
30
40

...so these are the row values .....i have to post these values like

10+20+30+40 = Non - data base item

please kindly send me the code logic ....

Re: calculating the values [message #353901 is a reply to message #353890] Wed, 15 October 2008 09:07
 subba99 Messages: 31Registered: September 2008 Member
did u tried the above steps,it will calculate the sum of the itemvalue for all rows

Regards
----------
subbu
Re: calculating the values [message #354444 is a reply to message #353901] Sun, 19 October 2008 02:01
 kommerashashi Messages: 23Registered: November 2007 Junior Member
dear SUBBU,
i know it will calculate each and every row but i required manually please send me the pl/sql code for that
Re: calculating the values [message #354911 is a reply to message #354444] Tue, 21 October 2008 23:42
 djmartin Messages: 10180Registered: March 2005 Location: Surges Bay TAS Australia Senior MemberAccount Moderator
Either loop through the records - start at the first record (row=1) and stop when 'last_record' is 'true', or do a 'select' on the table to get the information.

David
 Previous Topic: using POST in trigger Next Topic: scan image from oracle forms 10g
Goto Forum:

Current Time: Sun Aug 20 12:26:21 CDT 2017

Total time taken to generate the page: 0.08748 seconds