Microsoft KB Archive/100551: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 1: Line 1:
{|
{|
|width="100%"|
|width="100%"|
= FIX: Last Page in Report with New Page Option Says "Page 1" =
= FIX: Last Page in Report with New Page Option Says "Page 1" =


'''ID: Q100551'''
'''ID: Q100551'''
Line 13: Line 13:
== SYMPTOMS ==
== 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.
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 ==
== RESOLUTION ==
Line 24: Line 24:


         mypage = 1
         mypage = 1
         RETURN " "
         RETURN " "


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


         mypage = mypage + 1
         mypage = mypage + 1
         RETURN " "
         RETURN " "
</pre>
</pre>
2. Create a memory variable called &quot;mypage&quot; (without the quotation marks).
2. Create a memory variable called "mypage" (without the quotation marks).
<pre>  You can do this by executing the following command
<pre>  You can do this by executing the following command


Line 38: Line 38:
   either in the Command window or in the program that calls the report.
   either in the Command window or in the program that calls the report.
</pre>
</pre>
3. In the Group Header band, create a field called &quot;smypage()&quot;
3. In the Group Header band, create a field called "smypage()"
<pre>  (without the quotation marks).
<pre>  (without the quotation marks).
</pre>
</pre>
4. In the Page Footer band, create a field called &quot;mypage&quot; (without
4. In the Page Footer band, create a field called "mypage" (without
<pre>  the quotation marks).
<pre>  the quotation marks).
</pre>
</pre>
5. To the right of the mypage field, create another field called
5. To the right of the mypage field, create another field called
<pre>  &quot;imypage()&quot; (without the quotation marks).
<pre>  "imypage()" (without the quotation marks).
</pre>
</pre>
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.
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.
Line 64: Line 64:
3. Set up a data grouping on STATE.
3. Set up a data grouping on STATE.


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


<pre>  select the &quot;New Page (Page No. = 1)&quot; option.
<pre>  select the "New Page (Page No. = 1)" option.
</pre>
</pre>
5. From the Report menu, choose Page Preview.
5. From the Report menu, choose Page Preview.

Latest revision as of 12:56, 19 July 2020

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:

  • Microsoft FoxPro for Windows, version 2.5

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
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.