How to Export Records in a Grid Component to Excel or Ascii
Description
Records in a Grid Component can be exported to Excel or Ascii using built-in features of the Grid Component or Action Javascript.
Discussion
Records in a Grid Component can be exported to an Excel, Ascii, or Custom File format that can then be downloaded from the server to the user's machine. There are several features available for exporting Grid data to an Excel, Ascii, or Custom format.
The Grid Component has a property, "Excel to Export/Ascii" (shown in the image below), that can be used to add an Excel export button to the Grid Component's toolbar. This button will export the current records in the Grid Component to the specified file format (Excel or Ascii.)
You can also use Action Javascript to export data in a Grid Component. The "Export to Excel or Ascii or Custom Format" Action Javascript action can be used to export the Grid Component data to an Excel, Ascii, or Custom file format. The "Export to Excel or Ascii or Custom Format" action has a number of options for customizing the export, including the ability to define an Xbasic function that can be used to write the data to a Custom File format.
The videos below explain in detail how to export data from a Grid Component to an Excel, Ascii, or Custom file format using either the Grid Component property or Action Javascript:
Minimum Duration Between Export Actions
To reduce server load from repeated export actions, a new restriction has been added: there must be at least 10 seconds between successive export actions.
This prevents users from clicking rapidly on the Export button, which could otherwise trigger multiple Ajax callbacks to the server in quick succession.
Client-side Filename
You can specify the client-side filename for the exported file.
Security Groups
You can specify which security groups can see the Export button.
If you specify Security groups for the export action, only users who are logged into the specified group will see the Export button.
Export to Excel - No records
When the exported data has no records, field names are emitted into the first row in the Excel file.
See Also