Home » Developer & Programmer » Forms » cumulative Total of unknown number of columns........
cumulative Total of unknown number of columns........ [message #118284] Wed, 04 May 2005 02:35 Go to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi gurus,
I am facing a problem that I have a LOV from which I can select any item and give value of that particular item..I may select any number of rows(but one a t a time) and give values of that items..If I want to show dynamic sum in another field then what should I do........please help me....imtiaz

*** N.B: I may select any number of rows but one at a time....

Ya it is a tabular form(say I have rent,oil,rice,cream etc..)
I may select
goods(from LOV) Price(input price maually)
--------------- ---------------------------
1.oil 200
2.rice 100
----------
Total: 300

Now I want total of that values that I inputed....

[Updated on: Wed, 04 May 2005 03:01]

Report message to a moderator

Re: cumulative Total of unknown number of columns........ [message #118285 is a reply to message #118284] Wed, 04 May 2005 02:46 Go to previous messageGo to next message
weekend79
Messages: 198
Registered: April 2005
Location: Islamabad
Senior Member

Please clear your problem a bit more.

Is it a tabular form or not?
Are you selecting number filed from lov (i.e. rate, amount, price) and want total?

Wishes
Jawad
Re: cumulative Total of unknown number of columns........ [message #118290 is a reply to message #118284] Wed, 04 May 2005 02:58 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
LOVs are for selecting one and only one item.

If you want to select more than one item then create a block based on the table that your wish to list along with a check-box. Put them on a new canvas. When the user presses the LOV button, display this canvas (modal) and let them select the various check-boxes. Have an 'ok' and 'cancel' button on this modal pop-up canvas. When they press 'ok', scan the block and tally the records that have been checked.

David
Re: cumulative Total of unknown number of columns........ [message #118294 is a reply to message #118290] Wed, 04 May 2005 03:06 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi,
I will select one row at a time but not multiple rows at a time
but I need sum of them...imtiaz
Re: cumulative Total of unknown number of columns........ [message #118295 is a reply to message #118284] Wed, 04 May 2005 03:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Read the recend message http://www.orafaq.com/forum/t/45295/67467/ where we discuss globals and non-database blocks and fields.

What you need is a non-database block (CTRL) with a SUM field. This field is displayed one time on your canvas, probably underneath the price column of your multi-line display. In the pre-query trigger of the database block you initialise :CTRL.SUM to zero. Then in the post-query trigger you accumulate the price :CTRL.SUM := :CTRL.SUM + :BLK.PRICE

For new records you are going to have to accumulate the new price BUT you will have to make sure that if you cursor up and down the list that you don't accumulate it each time. Perhaps add a non-database field to the multi-record block eg SUMMED CHAR(1) intitial value 'N' then when you accumulate you set it to 'Y'. Then test that it is 'N' before doing the sum.

David
Re: cumulative Total of unknown number of columns........ [message #118409 is a reply to message #118295] Wed, 04 May 2005 23:38 Go to previous messageGo to next message
imtiazmasud
Messages: 49
Registered: May 2005
Location: Bangladesh
Member

Hi gurus,
I am going to try as you have said..imtiaz
Re: cumulative Total of unknown number of columns........ [message #119034 is a reply to message #118409] Tue, 10 May 2005 06:28 Go to previous messageGo to next message
subba lakshmi
Messages: 36
Registered: March 2005
Member
if you want to have sum of text1(i),text1(ii),text1(iii).... into textn then
set textn property as -

Calculation Mode - Summary
Summary Function - Sum
Summarized Block - Your Block Name
Summarized Item - text1.

if any problem contact.

from
subba lakshmi
Re: cumulative Total of unknown number of columns........ [message #119164 is a reply to message #118284] Tue, 10 May 2005 20:32 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Good call subba lakshmi, I have spend too much time migrating systems versus writing new ones. Calculation became available with Forms 6.
Previous Topic: Form Security Features
Next Topic: Record Groups VS Table types
Goto Forum:
  


Current Time: Thu Sep 19 18:07:40 CDT 2024