Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using report variables
Message
 
To
22/05/2002 08:57:15
Denis Filer
University of Oxford
United Kingdom
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00659812
Message ID:
00659874
Views:
26
>Cetin, I did as you suggested - and it works. However, I dont understand:
>a) why my use of variables did not work.
>b) where in the documentation I would find out how to use the (simpler) method you suggested.
>
>Thank you very much for the help. Denis

Denis,

Report Variables are completely separate animals from using the Calculate feature in a Field object. In fact, Report Variables can also be set to use the Calculate feature. In other words, you were using a variable to calculate .. then telling it to calculate the variable again inside the Field object. That's why your values were too high.

So look at it this way .. to SUM a value you can do it one of two ways:

1. Define a Report Variable, set the value to the field or expression you want to total, then select the SUM option. This Report Variable will be maintained by the Report Writer as it processes each record so to use the value, all you have to do is print the the variable itself in a Field object. If you were to print the variable in the detail band, it would be a running total of the field or expression you are SUMming.

2. Don't use a Report Variable at all ... instead ... just add a Field object in the Group Footer band, set the expression to the field you want to SUM, then set the SUM option under the calculate feature. The Report Writer will realize that you want the value SUMmed and it will maintain the SUM as it processes each detail band so it can print the SUM in the Group Footer band.


FYI ... I have a whole chapter on using Report Variables and calculations in my new book, "The Visual FoxPro Report Writer -- Pushing it to the Limit and Beyond", which is available from Hentzenwerke (www.hentzenwerke.com).

Cathy
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