Home » Developer & Programmer » Forms » How to Get Sum Of Tubular Form Column
How to Get Sum Of Tubular Form Column [message #120861] Tue, 24 May 2005 05:54 Go to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member



Summery Of Problem

How to calculate the sum of all values of a column in a “child tabular” form and assign sum to a field of parent table?
+ How to call the values of a tabular column (i.e. in simple for we call item as :Block_Name.Item_Name) but if a tabular column has 5 or n number of values in how to call?


Details Of Problem

Tbl_Master /*layout = form*/
Col_Date
Col_TotalPrice

Tbl_Child /*layout = tabular*/
Col_ItemName
Col_ItemPrice

I want to assign sum of all Col_ItemPrice to Col_TotalPrice.

I put a Post_Item trigger to Col_ItemPrice it work as set Col_Total := (NVL(Col_TotalPrice,0) + (Col_ItemPrice)).

It work well but it is not fool proof as if user update any value of Col_ItemPrice before save the Col_TotalPrice increase from actual sum.

So can some one give me a fool proof solution?

Wishes
Jawad
Re: How to Get Sum Of Tubular Form Column [message #120934 is a reply to message #120861] Tue, 24 May 2005 17:16 Go to previous messageGo to next message
aditya_gangadharam
Messages: 43
Registered: February 2005
Location: Hyderabad
Member

hi jawad,

do one thing keep another text box in the tabular column and in the property palette
do the following changes:
1) keep the calculation Mode as summary and then set the summary function to item name of the tabular which u want to add.
2) set the Number of Items Displayed to 1.

keep this text box in the parent block not in the child block

i think that this will solve your problem..
do well..



aditya..

Re: How to Get Sum Of Tubular Form Column [message #120961 is a reply to message #120861] Wed, 25 May 2005 02:30 Go to previous messageGo to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Dear aditya

Thanks for your help. It won’t work for me.

I did following. (Keep in mind my example of above post)

Got to property pallet of “Col_TotalPrice”
Calculation > Calculation Mode = Summery
Calculation > Summery Function = Sum
Calculation > Summarized Block = Tbl_Child
Calculation > Summarized Item = Col_ItemPrice

Records > Number Of Items Displayed = 1

But it wont compile and got the following error.

FRM-30377: Summery item must reside in single-record block or in same block as summarized item.

So you or someone else can help me?

Wishes
Jawad

Re: How to Get Sum Of Tubular Form Column [message #120968 is a reply to message #120961] Wed, 25 May 2005 04:07 Go to previous messageGo to next message
Gurusubramanyam
Messages: 79
Registered: July 2001
Member
Hi,

Keep the summary item in the same block. But in the layout you can move that item to a diffent place where ever you want.

Hope this will resolve your issue.

Thanks & Regards,
G.S
Re: How to Get Sum Of Tubular Form Column [message #120985 is a reply to message #120861] Wed, 25 May 2005 05:30 Go to previous messageGo to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Dear Gurusubramanyam

Ok your solution worked for summary item but how to pass the value of this new text_Item to the master block item?

Wishes
Jawad

[Updated on: Wed, 25 May 2005 05:47]

Report message to a moderator

Re: How to Get Sum Of Tubular Form Column [message #120997 is a reply to message #120985] Wed, 25 May 2005 06:19 Go to previous messageGo to next message
Gurusubramanyam
Messages: 79
Registered: July 2001
Member
Hi,

Either you can use "Copy Value from" property of the text item or use package/global variable to refer the values.

Bye,
G.S
Re: How to Get Sum Of Tubular Form Column [message #120999 is a reply to message #120861] Wed, 25 May 2005 06:27 Go to previous message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Dear Gurusubramanyam

thanks I have manager it with triggers.

Wishes
Jawad
Previous Topic: Getting Backend message in Forms
Next Topic: attaching pll librarys at run time
Goto Forum:
  


Current Time: Thu Sep 19 18:45:19 CDT 2024