-
Notifications
You must be signed in to change notification settings - Fork 17
Plugins
Roberto Prevato edited this page May 15, 2017
·
17 revisions
kingtable.xlsx.js
Plugin for client side export to Excel (xlsx). It is sufficient to add the plugin to page scripts: export menu will have automatically a new entry.
Polyfill: only for browsers that do not implement native Blob
object
Example:
<!-- Excel export -->
<script src="scripts/xlsx.core.min.js" async></script>
<script src="scripts/blob.js" async></script>
<script src="scripts/kingtable.js"></script>
<script src="scripts/kingtable.xlsx.js"></script>
Additional options in xlsx plugin.
Workbook name for exported .xlsx.
- type: string
- default: "data"
Cell width padding.
- type: number
- default: 0
Cell minimum width. Cells are sized automatically, depending on their content; this option allows to also define a minimum width for all cells.
- type: number
- default: 0
Whether all values should be exported as strings; instead of converting JavaScript dates to Excel dates, and keeping Numbers as such.
- type: boolean
- default: false
KingTable.defaults.excelWorkbookName = "data";
KingTable.defaults.excelCellPadding = 0;
KingTable.defaults.excelCellMinWidth = 0;
KingTable.defaults.excelAllStrings = false;
Extra regional key:
regional.en.exportFormats.xlsx // en: "Excel (.xlsx)"