FIX: Last Page in Report with New Page Option Says "Page 1"

ID: Q100551

2.50 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

SYMPTOMS

In the Report Writer, the "New Page (Page No. = 1)" option does not function correctly. When you select the "New Page (Page No. = 1)" option in the Group Info dialog box (to open the dialog box, choose Data Groupings from the Report menu, then choose the Add button), the page number is set back to 1 on the last page of a group that spans more than one page.

RESOLUTION

To work around this problem, do the following:

1. Create the following user-defined functions (UDFs):

   a. Type the following in a file called SMYPAGE.PRG:

         mypage = 1
         RETURN " "

   b. Type the following in a file called IMYPAGE.PRG:

         mypage = mypage + 1
         RETURN " "

2. Create a memory variable called "mypage" (without the quotation marks).
   You can do this by executing the following command

      mypage = 0

   either in the Command window or in the program that calls the report.

3. In the Group Header band, create a field called "smypage()"
   (without the quotation marks).

4. In the Page Footer band, create a field called "mypage" (without
   the quotation marks).

5. To the right of the mypage field, create another field called
   "imypage()" (without the quotation marks).

The mypage field will display the correct page number. It is important to follow these steps in order because the fields will be called in the order they are created. Otherwise, mypage could be incremented prior to displaying the page number.

STATUS

Microsoft has confirmed this to be a problem in FoxPro 2.5 for Windows. This problem was corrected in FoxPro 2.5a for Windows.

This problem does not occur in FoxPro 2.5 for MS-DOS.

MORE INFORMATION

Steps to Reproduce Problem

1. Use the CUSTOMER.DBF file and set the order to STATE.

2. Create a quick report in FoxPro for Windows using CUSTOMER.DBF.

3. Set up a data grouping on STATE.

4. In the Group Info dialog box, under "When Group Changes, Begin",

   select the "New Page (Page No. = 1)" option.

5. From the Report menu, choose Page Preview.

6. Zoom in on the page number. On groups that span more than one page,

   the page number on the last page of the group is set to 1 instead
   of incrementing again.

Additional reference words: FoxWin 2.50 buglist2.50 fixlist2.50a RWriter KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxtoolRwriter Solution Type : kbfix

Last Reviewed: September 22, 1997