How to Call GENXTAB.PRG

Last reviewed: April 30, 1996
Article ID: Q113971
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, 2.5b, 2.6
  • Microsoft FoxPro for Macintosh, version 2.5b

SUMMARY

You can access GENXTAB, the program that generates cross-tabulations, outside RQBE and gain more control over how the cross-tabulations are generated and how they look. GENXTAB expects only three fields in the table it is working with. If there are more than this, GENXTAB will produce an error.

For information about working with a table that has more than three fields, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q113525
   TITLE     : How to Make GENXTAB.PRG Work with Any Table/.DBF

MORE INFORMATION

GENXTAB.PRG has eight parameters that can be passed to it:

   DO GENXTAB WITH <output_file>, [<output_type}], [<close_source>], ;
      [<show_thermometer>], [<row>], [<column>], [<cell>], [<row_total>]

Parameter Explanation

  1. <output_file>: a character parameter that specifies the name of the output table/cursor.

  2. <output_type>: a logical parameter which if .T. forces the output file to be a cursor. If this parameter is not specified or is .F., the output type is the same as the source. In other words, if the source is a cursor, GENXTAB outputs a cursor; if the source is a table, GENXTAB outputs a table.

  3. <close_source>: a logical parameter which if .T. or not specified will cause the source table/cursor (which GENXTAB used to create the cross- tabulation) to be closed. If this parameter is .F., the source is left open.

  4. <show_thermometer>: a logical parameter which if .T. or not specified will show the thermometer when GENXTAB is working (default behavior). If the parameter is .F., no thermometer will show.

  5. <row>: a numeric parameter that specifies the field number of the input table/cursor that correlates to the rows in the cross-tabulated output.

  6. <column>: a numeric parameter that specifies the field number of the input table/cursor that correlates to the columns in the cross-tabulated output.

  7. <cell>: a numeric parameter that specifies the field number of the input table/cursor that correlates to the intersection of the rows and the columns (the cells).

  8. <row_total>: a logical field which if .T. will tell GENXTAB to generate an extra column to the output that is a total of all the cells in a row (cross totals). The default for this option is .F.

Code Example

   *SET DEFAULT to the TUTORIAL subdirectory or folder, then run the
   *following code.
   SELECT cno, idate, itotal ;
      FROM invoices ;
      ORDER BY cno, idate ;
      GROUP BY cno, idate ;
      INTO CURSOR mtest
   DO sys(2004)+'GENXTAB.PRG' WITH 'xtabd', .T., .T., .F., 1, 2, 3, .T.
   BROWSE


Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50 2.50a 2.50b 2.60
crosstab
cross tab
cross-tab
KBCategory: kbprg
KBSubcategory: FxtoolRqbe


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: April 30, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.