Create and save an Excel XLSX file that contains the data from the table (Adobe Flash - deprecated).
Please note - this property requires the Buttons extension for DataTables.
As of v1.2.0 this feature has been deprecated. This feature has not yet been scheduled for removal, but its use is discouraged and the alternatives discussed below should be used.
As Flash is now being expunged from all browsers, the Flash buttons are only suitable for use in old browsers. As such, they will no longer see new features developed for them after Buttons 1.2.0. They will be removed from the distribution in the next major release.
This button provides the end user with the ability to save the table's data into a locally created Excel XLSX file.
Please note that this button has a number of restrictions:
- Adobe Flash must be installed.
- The action for this button cannot be activated using the
button().trigger()or key combination methods due to the security restrictions of Flash
- The created file save dialogue must be shown and the file cannot be automatically opened.
- The XLSX file cannot contain any styling information. Only the raw data from the table is included.
excelHtml5 method provides much greater flexibility and thus button is considered to be sunsetted, but is still provided for use with older browsers that do not support the APIs required for the
excelHtml5 button type.
Adobe Flash is required for this button to operate. If Flash is not installed, or disabled, in the end user's browser this button will not appear. For a non-Flash alternative please see the
excelHtml5 button type. Additionally the
excel will automatically select between this button and
excelHtml5 depending on the features of the browser.
The Excel file that Buttons creates is intentionally quite simple, but you may wish to add additional information or formatting to the document to suit your output requirements. This ability is provided by the
customize option of this button type.
Full details of the
customize method are available in the
excelHtml5 documentation. The
customize method for both button types are identical and a function developed for one can be used for the other (or both if you use the grouping
excel button type, which will automatically select HTML5 or Flash as required for the browser).
This button can have the following options set in its configuration object to customise its actions and display:
Create and save a Excel XLSX file.
The button's class name. See
Option to instruct the Excel export to create empty cells. By default if a cell contains
This method can be used to modify the XSLX file that is created by Buttons. The first parameter that is passed in is an object that contains the XML files and the object structure matches the file system paths for those files in an XSLX file. Customisation of the XSLX file is a complex topic - please refer to the Customisation section in the
As of Buttons 1.5.2 this function is passed three parameters:
Select the data to be gathered from the DataTable for export. This includes options for which columns, rows, ordering and search. Please see the
The extension to give the created file name.
The character(s) used to enclose each field in the plain text representation of the table that is copied to the system's clipboard. This is automatically added at the start and end of each cell's data.
The character(s) used to separate fields in the plain text representation of the table that is copied to the system's clipboard.
File name to give the created file (plus the extension defined by the
Indicate if the table footer should be included in the exported data or not.
Indicate if the table header should be included in the exported data or not.
Message to be shown at the bottom of the table, or the
Message to be shown at the top of the table, or the
Name for the worksheet in Excel file created. The characters  \ /: *? : are not allowed and will be removed if present.
Title of the table that will be included in the exported data. Please see
DataTables initialisation: Use the Flash Excel button:
DataTables initialisation: Use the
excel button type to automatically select between the Flash and HTML button options.:
DataTables initialisation: Use the
exportOptions to save only the data shown on the current DataTable page:
text: 'Save current page',