TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
EnglishBob2
When:
7 Mar 2013 4:31 AM
Last revision by
Richard Mueller
(cMVP, Microsoft Community Contributo)
When:
28 Mar 2013 7:16 PM
Revisions:
3
Comments:
1
Options
Subscribe to Article (RSS)
Share this
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
VFP Printing B/Fwd and C/Fwd Page Totals
VFP Printing B/Fwd and C/Fwd Page Totals
Article
History
VFP Printing B/Fwd and C/Fwd Page Totals
These days it is not often that users want to print great swathes of paper of - say - all the journals posted to a ledger or even to a single ledger account.
On-line realtime systems have greatly reduced the need for such printouts.
However, I received a request to put Carry Forward (C/Fwd) and Brought Forward (B/Fwd) totals into a report when the number of journals to an individual account went over N+ pages.
Easy I thought. Just sum the detail amounts and put a B/Fwd in the page header and a C/Fwd in the page footer to print the interim totals. Only print the C/Fwd and B/Fwds when the interim total is not Zero by setting the 'Print When' condition to MYCBFWDTOT <> 0
Worked fine until:
a) an account ended near the bottom of the page
b) at a page throw the account just happened to total zero
For a) an account total was given. This should have cleared the the C/Fwd and B/Fwd's to zero. Unfortunately this clearing back to zero does not occur until the new account group is encountered on the next page - so the C/Fwd and B/Fwd showed the prior accounts total.
For b) no C/Fwd or B/Fwd totals were given because MYCBFWDTOT happened to be zero at the point of a page throw.
Thus a little research and a lot of testing to resolve these issues arose.
It was resolved using the VFP9 facility to run an expression when a print band (page header/footer, group header/footer, detail) is entered or exited.
First I declared a report variable MYCBFWDPRINT and set it to .F. (False)
Then the Detail band Entry Expression was set to
_VFP.SetVar('MYCBFWDPRINT', .T.)
Which sets the report variable to true when first printing a detail line.
(A function call is required here as a direct Assignment Expression is not permitted.)
Then the Account Group Footer band Entry Expression was set to
_VFP.SetVar('MYCBFWDPRINT', .F.)
Which sets the report variable to false when entering the account totals print band.
Then finally in the print controls for the C/Fwd and B/Fwd amounts the Print When condition was set to just -
MYCBFWDPRINT
This solved all the problems prevously encountered by controlling printing on the value of MYCBFWDPRINT and not the MYCBFWDTOT variable.
Such Entry and Exit expressions can be used by a programmer to achieve more user friendly and flexible report layouts.
Brought Forward
,
Carry Forward
,
en-US
,
Group totals over N pages
,
Reporting
,
VFP
,
Visual FoxPro
[Edit tags]
Leave a Comment
Please add 4 and 3 and type the answer here:
Post
Wiki - Revision Comment List(Revision Comment)
Sort by:
Published Date
|
Most Recent
|
Most Useful
Comments
Richard Mueller
28 Mar 2013 7:16 PM
Richard Mueller edited Revision 1. Comment: Modified title casing
Edit
Page 1 of 1 (1 items)
Wikis - Comment List
Sort by:
Published Date
|
Most Recent
|
Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
Posted by
Richard Mueller
on
28 Mar 2013 7:16 PM
Richard Mueller edited Revision 1. Comment: Modified title casing
Edit
Page 1 of 1 (1 items)