Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print group total on last line of detail band
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Novell 6.x
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01194501
Message ID:
01196006
Views:
15
>Greetings one and all
>I am attempting to print a group total to the right of the last object on the last detail line of a detail band in "classic accounting journal style". I tried moving the total object to the detail line and printing only on group change. That didn't work. Any ideas??
>
>Thanks, Vince

You can create a report variable that SUMS the total and resets at each data group. The trick is how the detail band is going to figure out whether it is the last record in the data group.

One idea you can do is this:

- Create a report variable called rnLast. Set the initial value to .f. and set the expression to rnLast so that it just sets itself to itself for each detail band.

- Create a data group with an expression of RECNO()

- In the OnEntry expression of the data group, put an expression that calls a UDF or method, such as TestForLast().

- Create the UDF or method with code that remembers the record pointer, moves it ahead one, checks to see if the "next" record is still in the same group, then sets rlLast to true or false depending on what it found. Then make sure to move the record pointer back to the record it was on.

- In the detail band, use rlLast in the Print When expression for that field.


The concept sounds a little weird, but it does work.
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