Microsoft KB Archive/149849

= FIX: Report Writer incorrectly numbers pages of a report =

Article ID: 149849

Article Last Modified on 2/11/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q149849



SYMPTOMS
In Visual FoxPro versions 3.0 and 3.0b, the first pages of data in a report created by Report Writer are numbered incorrectly when the following three conditions are met:


 * There is a title page.
 * Data grouping is set to reset the page number to 1.
 * Data grouping is set to start each new group on a new page.

Using the Customer table as an example, if the first City in the table is Adak, the Report Writer variable _pageno prints the number 2 instead of the number 1 for the first page. If the second City is Boston, the first Boston page will be correctly numbered 1, and all pages after it will be correctly numbered.



WORKAROUND
The following workaround applies to the example given in the "More Information" section below:


 * 1) Create a report variable named cOldcity. Type cOldcity in Value to Store. Type city in Initial Value.
 * 2) Select Release After Report and Reset: End of Report.
 * 3) Replace the _PAGENO expression in the page footer with IIF(cOldcity=city,_pageno-1,_pageno).



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0 for Windows.



Steps to Reproduce Problem

 * 1) Create a new report. Add the Customer table from the Vfp\Samples\Data subdirectory and order the table by the City field. Click Report, click Quick Report, and accept the defaults.
 * 2) Group the report by City, select Reset Page Number to 1 for each group, and select Reprint Group Header on each page.
 * 3) Click Report, Title/Summary, and select Title band and New Page.
 * 4) Preview the report. Notice that the first page of data after the title page is page 2, instead of page 1. Had there been more than one page for the first city, each page would be numbered incorrectly. Subsequent groups are numbered correctly.

Keywords: kbbug kbfix kbvfp500fix KB149849

-

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

© Microsoft Corporation. All rights reserved.