Export to Excel or Ascii or Custom Format

Description

Export data to Excel or Ascii or Custom Format. The Custom format option allows you to define an Xbasic function that creates the file.

Action Javascript action available in the Grid Component that exports records in the Grid Component to Excel, Ascii, or a Custom File format.

 Export Data Properties

Export type
Specify the format of the exported data. If you select Custom, you can define your own Xbasic function to create the export file in any format that you want. For Excel select 'Excel' to create a .xls file and 'Excel-XLSX' for a .xlsx file. Choices include Excel, Excel-XLSX, Comma delimited ascii, Tab delimited ascii, Custom.
Custom format Xbasic function
Specify the name of the Xbasic function that will create the custom file you want to export. This function must be defined in the Xbasic Function Declarations property. TIP: Click the hyperlink at the bottom to get the correct function prototype.
Source
Specify what fields should be exported.
Client-side filename
Specify the default filename to use when saving the file on the user's computer. The user can override the suggested name. If you set the name to <Default>, Alpha Anywhere will generate the filename.
Zip file
Specify if the exported file should be zipped before it is downloaded to the user's computer.
Export hidden fields
Should 'hidden' fields be exported? ('Hidden' fields are not necessarily actually hidden when the Grid is displayed - they could be shown in another column's Free-form layout section).
Use Grid column headings
Should the column headings in the export file be the same as the Grid Column Headings? If unchecked, the field name is used.
Field list
Select fields to export.
Record selection
Specify if only the records in the current Grid query should be exported, or all records in the Grid. Choices include Records in current query, All records, Current record only.
Maximum number of records
Specify the maximum number of records to export. Set to 0 for no limit.

 Custom Export Properties

Custom type
Specify if the query is against DBF tables or a SQL database. Choices include DBF, SQL.
DBF Table
Specify the name of the DBF table.
Field names
Specify the names of the fields in the DBF table that you want to export
Filter - DBF
Specify the filter expression.
Order - DBF
Specify the filter expression.
Connection string
Specify the connection string.
SQL Select
Specify the SQL Select statement.
Filter - SQL
Specify the filter expression. (This is in addition to any WHERE clause defined in your SELECT statement.)
Order - SQL
Specify the filter expression.
Arguments
You can use arguments in the filter expressions that you define. Using arguments for variable data makes it easier to write your filter expressions.
Argument bindings
Specify where each argument that have defined gets its value. Arguments can get their values from a value in the current Grid row, a session variable, or a literal value.

 Events - Server-Side Properties

After export
Specify the name of the Xbasic function to call after the records have been exported and the export file has been created, but before the file has been sent to the browser. Function is defined in Xbasic Function Declarations section.

 Events - Client-Side Properties

Before export
Specify the name of the Javascript function to call before records are exported. This function must return true, or false. If false, export is aborted. Function is defined in Javascript Function Declarations section.
After export
Specify the name of the Javascript function to call before after the records have been exported and the file has been downloaded to the browser. Function is defined in Javascript Function Declarations section.

Limitations

Grid Component Only

See Also