How to Call GENXTAB.PRG

ID: Q113971

2.00 2.50 2.50a 2.50b 2.60 | 2.50 2.50a 2.50b 2.60 | 2.50b

MS-DOS                     | WINDOWS               | MACINTOSH
kbprg

The information in this article applies to:

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
Keywords          : FxtoolRqbe 
Version           : 2.00 2.50 2.50a 2.50b 2.60 | 2.5
Platform          : MACINTOSH MS-DOS WINDOWS

Last Reviewed: May 1, 1996