COPY2XLS
Used in a JUSTAFTER to export fields from a report into an Excel file.
Reporting Area(s)
General
Required Parameters
None
Optional Parameters
- Character return string: specified fields to export. IMPORTANT: fields listed MUST be in report cursor.
- Character return string: path/name of file. If none is specified, an Open dialog opens for you to select the place to save the file/enter the file name.
- Character string to set type of export file. Defaults to 'XLS'. Other options are: 'CSV', 'FOXPLUS', 'SDF', 'DELI', 'XLSX', and 'XML'.
Example(s)
JUSTAFTER("COPY2XLS()") - exports all fields to an Excel file and allows you to select location of saved file/enter file name.
JUSTAFTER("COPY2XLS('nmname1,nmname3,nmemail')") - exports first name, last name, and email address to an Excel file and allows you to select location of saved file/enter file name.
JUSTAFTER("COPY2XLS(,'c:\acehold\emails.xls')") - exports all fields to an Excel file named emails.xls into the c:\acehold folder.
JUSTAFTER("COPY2XLS(,,'CSV')") - exports all fields to an CSV file and allows you to select location of saved file/enter file name.
Fieldlist Variables
If the list of fields you want to export is longer than the 255 character limit of the JUSTAFTER, you can create a variable and add the fields to the Value to Store field. Then use the variable name in the function.
Example of a fieldlist variable. Note the field list must be in quotes:
Then use the fieldlist variable in the function:
JUSTAFTER("COPY2XLS(fieldlist)")
Variables are also subject to the 255 character limit. If you need to export more than can fit in 1 variable, you can use 2 (e.g. fieldlist1 and fieldlist2).
In the JUSTAFTER, you put both variables, separated with the comma delimiter:
JUSTAFTER("COPY2XLS(fieldlist1+', '+fieldlist2)")