Microsoft KB Archive/113971

{| = How to Call GENXTAB.PRG =
 * width="100%"|

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:


 * 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 , [], ; [], [ ], [ ], [ ], []

Parameter Explanation
1. : a character parameter that specifies the name of the

output table/cursor. 2. : 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. : 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. : 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. : a numeric parameter that specifies the field number of the input table/cursor that correlates to the rows in the cross-tabulated output. 6. : a numeric parameter that specifies the field number of the input table/cursor that correlates to the columns in the cross-tabulated output. 7. : 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. : 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
 * }