FIX: Reprint Group Header Problem with Two Data Groupings

Last reviewed: October 29, 1997
Article ID: Q147574
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0
  • Microsoft Visual FoxPro for Macintosh, version 3.0b

SYMPTOMS

If you create a report with two or more data groupings with the "Reprint Group Header on Each Page" check box selected for all data groupings, the groupings will print in incorrect order on the first page and on subsequent pages when a new outer grouping starts on a new page.

WORKAROUND

NOTE: For this workaround to work, each new outer grouping must start on a new page.

Follow the steps in the "Steps to Reproduce Problem" section of this article, and then make the following changes to the report:

  1. In the Data Grouping dialog box, select the shipper_id group, and select the "Start Each Group on a New Page" check box.

  2. Move all fields from Group Header 1 to the Page Header (you may need to enlarge the Page Header band), and shrink the Group Header 1 band height to 0.

  3. Create a report Variable, and give it the following settings:

    Name - grpcount Value to Store - grpcount + 1 Initial Value - 0 Calculate - Sum Reset - shipper_id

  4. Select all the fields in Group Header 2. Copy them, and then paste them into the Page Header. On each of these new fields in the Page Header, choose Print When, and in the "Print Only When Expression Is True" text box, enter this expression:

    grpcount = 0

    Select the "Remove Line If Blank" check box.

  5. On all the fields in Group Header 2 choose Print When, and in the "Print Only When Expression is True" text box, enter this expression

    grpcount > 0

    Select the "Remove Line If Blank" check box.

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.0a.

MORE INFORMATION

Steps to Reproduce Problem

  1. Open Orders.dbf from the Tastrade database located in the Samples\Mainsamp\Data subdirectory.

  2. Create a new index tag named ShipCust on this expression:

    shipper_id + customer_id

  3. Create a new report, and add the Orders table to the Data Environment.

  4. In the properties sheet of the Data Environment, in the Data tab of the Cursor object, set the Order property to ShipCust.

  5. Add two Data Groupings to the report, the first (outer) being shipper_id and the scond (inner) being customer_id. In both cases, select the "Reprint Group Header on Each Page" check box.

  6. Add a label named Outer Group to the Group Header 1, and add a label named Inner Group to the Group Header 2.

  7. Preview the report. Note that Inner Group prints above Outer Group on the first page. It is also possible to arrange the report so that the shipper_id changes between pages, in which case the problem repeats itself on the first page that displays the new shipper_id.

REFERENCES

For more information about the technique used in this article, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q94343
   TITLE     : Obtaining Number of Data Groups in .FRX Without Using UDF
Keywords          : buglist3.00 buglist3.00b buglist5.00 FxtoolRwriter vfoxwin vfpfix5.0a kbtool kbbuglist kbfixlist
Version           : 3.0 3.0b 5.0
Platform          : MACINTOSH WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.