Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Showing month totals in grouping of report
Message
 
To
22/09/2008 16:45:07
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01349560
Message ID:
01349785
Views:
21
>I wish we could upload images/screenshots.
>
>I have 2 cursors created; one that feeds the detail and one for the summary. Basically, there is a date displayed in a left column, and then some other non-relevant fields to the right of that, all on the detail line. There is a grouping by the date, with no repeated values so the date only shows up once, on the first line in the grouping. There are boxes/lines that give it a nice look, but it only seems to work well if I pull the bottom of the box just to the bottom of the grouping footer. I've added that one, which groups on a value of .T., just to have a place to put the summary information directly below the first grouping (date). And, let's assume that there are only like 10 detail lines in the result, so the last one ends in the middle of the page. Any other way than using the fake grouping I've tried either puts the summary information at the very bottom of the page or messes up the boxes/lines. Right now the boxes/lines fill-up the entire page regardless of how many detail lines there are. We like that. Just need to find a way to get the month totals, based on the date range in the where clause, to display just below the last detail line at the end of the report.


Question ... Can you use the Page Footer for this? That would mean that the space you defined in the page footer isn't used on all the other pages, even it's not the end of the group. There's a fairly simple way if this is acceptable.

However, if that's not acceptable, there are a few ways to force stuff to a certain position on the page. If you do NOT have any stretchable fields, you can get away with counting the detail lines with a report variable as they print, then using a dummy object at the top of the page footer band that has an expression something like this: REPLICATE(CHR(13), 99-rnLines). You just have to figure out what number to use in place of the "99" to get it positioned where you want .. also make sure it's as wide as the report, marked as stretchable, and everything below it is "float".

If the above isn't acceptable, the other way to accomplish this is using a Report Listener. In the "In Action" article I wrote (see the link in my tag line) there are some examples of using shapes to fudge the position of items. There's one on keeping groups together and one on 2 up forms. You can take similar concepts from those examples and put a shape in your data group footer band and then use the AdjustObjectSize method in the report listener to fudge the size of the shape so that it moves everything else down to where you want it.
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
Reply
Map
View

Click here to load this message in the networking platform