This feature allows for exporting cursor data into Excel or OpenOffice spreadsheets, similarly to the COPY TO … TYPE XL5 command, with the following enhancements:
- The number of records is not limited to 65K
- Formatting options, including dynamic formatting
Running the export
Run XFRX_CopyToXLSX or XFRX_CopyToODS procedure inside XFRX.PRG/FXP with the following parameters:
- lcAlias - Source ALIAS (required)
- lcFile - Output file name (required)
- lcFCCallBack - Callback function name - please see Formatting options below (optional)
- lcSheetName - Excel sheet name (optional)
- llOnlyData - Export only data - no headers (optional)
Example
OPEN DATABASE "C:\Program Files (x86)\Microsoft Visual FoxPro 9\Samples\Northwind\Northwind" USE "Invoices" SET PROCEDURE TO xfrx.prg m.liErr=XFRX_CopyToXLSX("Invoices", "test.xlsx", , "Invoices") IF m.liErr<>0 ?"ERROR",m.liErr ENDIF