Skip to content

Plugins

Roberto Prevato edited this page May 15, 2017 · 17 revisions

Excel CS Export

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.

Export to xlsx

Dependencies:


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>

Options

Additional options in xlsx plugin.

excelWorkbookName

Workbook name for exported .xlsx.

  • type: string
  • default: "data"

excelCellPadding

Cell width padding.

  • type: number
  • default: 0

excelCellMinWidth

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

excelAllStrings

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;

Regional

Extra regional key:

regional.en.exportFormats.xlsx // en: "Excel (.xlsx)"