BUG: Group Header Information Prints Incorrectly (135617)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 3.0
  • Microsoft Visual FoxPro for Windows 3.0b
  • Microsoft Visual FoxPro for Windows 5.0
  • Microsoft Visual FoxPro for Windows 5.0a

This article was previously published under Q135617

SYMPTOMS

Group header information prints incorrectly when all of the following are true:
  • The group is defined to start on a new page.
  • The group header is defined to print on every page.
  • The group footer is the only band that prints on the last page of the group.
In this case, the group header information printed on the last page of the group is actually the header information for the next record. In Visual FoxPro version 5.0, the group header does not print at all in this case.

WORKAROUND

This workaround does not apply to Visual FoxPro version 5.0. There does not appear to be a workaround to make the group footer print in the case described above.
  1. Add a field to the Group Header. Set the field expression to a variable (for example, "repx").
  2. Add a field to the Group Footer. Set "Print Only When Expression is True" to .F. and "Field Expression" to a UDF (for example, "letsgo()").
  3. In the UDF type the following:
          repx=AGROUPS(i)  &&agroups is array that holds group header info.
          IF i<ALEN(agroups)
            i=i+1
          ENDIF
          RETURN
  4. Create a program for calling the report. Type the following into the prg:
          Select <insert fieldname of group> from <insert tablename> ;
            Group by <insert fieldname of group> into array agroups
          i=2

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Modification Type:MajorLast Reviewed:5/7/2003
Keywords:kbBug kbprint KB135617 kbAudDeveloper