Microsoft KB Archive/109152

From BetaArchive Wiki
Knowledge Base


How create a data grouping that breaks after a certain number of records in Visual FoxPro

Article ID: 109152

Article Last Modified on 2/12/2007



APPLIES TO

  • Microsoft Visual FoxPro 3.0 Standard Edition
  • Microsoft Visual FoxPro 7.0 Professional Edition
  • Microsoft Visual FoxPro 8.0 Professional Edition
  • Microsoft Visual FoxPro 9.0 Professional Edition



This article was previously published under Q109152

SUMMARY

In the Visual FoxPro Report Designer, you can create a data grouping that will break after a certain number of records.

For example, the following procedure will create a data grouping that breaks after every fifth record.

  1. Create a quick report based on theCustomer table.
  2. From the Report menu, choose Variables.
  3. Choose Add to add a variable.
  4. For the variable name, type cntr.
  5. For the value to store, type Customer.region. (In VFP 3.0, type Customer.state.)
  6. Select the Count radio button in the Calculate box and choose OK twice to return to the report.
  7. From the Report menu, choose Data Grouping.
  8. Choose Add to add a Data Grouping.
  9. Enter the following expression to group on:
    • INT(cntr/5)
  10. Select OK twice to return to the report. You can now place fields and text in the group header and footer, which will print every fifth record.



Additional query words: VFoxWin FoxMac FoxDos FoxWin RWriter

Keywords: KB109152