Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PageFrame with Grid and SUM total
Message
From
04/03/2000 17:47:10
 
 
To
04/03/2000 17:23:24
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00341750
Message ID:
00341755
Views:
20
HI Joao,

I do it this way. I create several form properties to store interm values and then add a method to the form with code like this:
LOCAL slnCurArea,slnRecNo

DO CASE
CASE EOF('Invoice')
ThisForm.nsubtotal = 0
ThisForm.ntax =0
ThisForm.ntotal = 0
CASE EOF('invoice_items')
ThisForm.nsubtotal = 0
ThisForm.ntax = 0
ThisForm.ntotal = 0
OTHERWISE
slnCurArea = SELECT()
SELECT invoice_items
slnRecNo = RECNO()

SUM invoice_items.price*invoice_items.qty ;
FOR invoice_items.invoice_number = invoice.invoice_nu ;
TO ThisForm.nsubtotal

SUM EVAL(thisform.pgfChild.page1.grdChild.Column7.controlsource);
FOR invoice_items.invoice_number = invoice.invoice_nu ;
TO ThisForm.nTax

GOTO slnRecNo
SELECT (slnCurArea)
ThisForm.ntotal = ThisForm.nsubtotal+ThisForm.ntax

ENDCASE

ThisForm.pgfChild.page1.txtsubtotal.Refresh()
ThisForm.pgfChild.page1.txttax.Refresh()
ThisForm.pgfChild.Page1.txttotal.Refresh()

refreshing the form then updates the totals. Don't know if this is the proper way to do it but it works, well.
Also note some of the code above is dependent on the form of mine I pulled it out of so mods will need to be made to work for you. It's only provided as a guide to show the idea


>HI, Mike
>
>My sum is outside the grid, not in the grid, what's the way to sum all the lines in grid and have a result outside the grid.
>
>Thank's for your time,
>
>Joao Batista
>(jbinf@mail.telepac.pt)
Tony
Skill comes from Diligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform