Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to sum subgroup
Message
 
To
11/01/2006 04:56:23
Mk Sharma
Shrishti Solutions
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01085512
Message ID:
01087479
Views:
8
This message has been marked as the solution to the initial question of the thread.
You shouldn't need to use SEEK or INDEXSEEK to solve this problem. Here's a better way to do it.

- Create a report variable called rnBoxTotal. Set the initial value to 0, set the expression to 0, set the calculate option to SUM, and define it to reset at the Group1 break.

- In the OnExit Expression of the Group2 Footer band, enter this:

_vfp.SetVar('rnBoxTotal', rnBoxTotal + (gqty / perbox))


What this does is create a report variable that is zero, and since it is marked as SUM, it just adds zero to itself for every detail record. So far .. you have zero. The expresion in the OnExit of the Group2 Footer band will add the box count for that group to the report variable. Because the report variable is defined to just add zero to itself for each detail record, you don't have to worry about it destroying the value you just added to it. When you get to the Group1 Footer ... use rnBoxTotal for the box count. It will then reset itself for the next Group1.
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform