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
- <output_file>: a character parameter that specifies the name of the
output table/cursor.
- <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.
- <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.
- <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.
- <row>: a numeric parameter that specifies the field number of the input
table/cursor that correlates to the rows in the cross-tabulated output.
- <column>: a numeric parameter that specifies the field number of the
input table/cursor that correlates to the columns in the cross-tabulated
output.
- <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).
- <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