Microsoft KB Archive/118560

= How to indicate record continues on the next page of a report =

Article ID: 118560

Article Last Modified on 2/11/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.6 Standard Edition
 * Microsoft FoxPro 2.6a Standard Edition

-



This article was previously published under Q118560



SUMMARY
The Report Writer in FoxPro has limited widow and orphan control. Widows and orphans occur when a record is split between two pages. For example, if you have a report that prints out data in such a manner that a record stretches beyond the bottom of the page, the remainder of the record's data is printed on the following page. The part that prints on the first page is the called a widow. The part that prints on the second page is called an orphan. This is often undesired and potentially confusing behavior.

While there is little that can be done to prevent the record from being split, you can have the Report Writer indicate to the reader of the report that the record has spilled over to the next page. This will at least lessen the reader's confusion.



MORE INFORMATION
To provide this kind of notification, you can create a memory variable that is changed to a specific value every time a group changes and is reset to a different value at the end of each group. If the variable is not equal to the specific value when it is evaluated in the Page Footer band, this means that the record continues on the next page. In this case, a message such as "Continued on next page..." will notify the reader that the record continues on the next page.

The following steps illustrate this method:

 Open a database such as ARTICLE.DBF, which comes with the FoxPro Distribution Kit. Create a quick report. Create a grouping on ARTICLE.TITLE. Create a variable called NEWGROUP with an initial value of .F., set Value To Store to .T., and select ARTICLE.TITLE for Reset. Create another variable called COUNT with an initial value of 0, set Value To Store to 1, select End Of Report for Reset, and select Count under Calculate.  In the Page Footer band of the report, create the following expression: IIF(!newgroup,"Continued on next page...","")   In the PRINT WHEN clause of this expression, select No for Print Repeated Values, and then select the Print Only When Expression Is True box. Type the following expression in the Expression Builder: COUNT < RECCOUNT </li> From the Report menu, choose Page Preview and examine the bottom of each page. Note that the words "Continued on next page..." appear.</li></ol>

For information about preventing orphans, please see the following Microsoft Knowledge Base article:

101297 Widow and Orphan Control in FoxPro Report Writer

Additional query words: VFoxWin FoxWin 2.50 dk

Keywords: KB118560

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.