Microsoft KB Archive/147574

= FIX: Reprint Group Header Problem with Two Data Groupings =

Article ID: 147574

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q147574



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:

 In the Data Grouping dialog box, select the shipper_id group, and select the "Start Each Group on a New Page" check box. 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. 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

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

<div class="moreinformation_section">

Steps to Reproduce Problem
 Open Orders.dbf from the Tastrade database located in the Samples\Mainsamp\Data subdirectory.</li>  Create a new index tag named ShipCust on this expression: shipper_id + customer_id </li> Create a new report, and add the Orders table to the Data Environment.</li> In the properties sheet of the Data Environment, in the Data tab of the Cursor object, set the Order property to ShipCust.</li> 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.</li> Add a label named Outer Group to the Group Header 1, and add a label named Inner Group to the Group Header 2.</li> 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.</li></ol>

<div class="references_section">