v7.3.0

ExcelExporter
Feature

A feature that allows exporting Calendar data to Excel or CSV without involving the server. It uses TableExporter class as data provider, 3rd party provider to generate XLS files, and Microsoft XML specification.

import WriteExcelFileProvider from '../../lib/Grid/feature/experimental/xlsproviders/WriteExcelFileProvider.js';

new Calendar({ features : { excelExporter : { xlsProvider : WriteExcelFileProvider } } });

Here is an example of how to add the feature:

const calendar = new Calendar({
    features : {
        excelExporter : {
            // Choose the date format for date fields
            dateFormat : 'YYYY-MM-DD HH:mm',
            exporterConfig : {
                // Choose the Resource fields to include in the exported file
                resourceColumns : [{ text : 'Calendar', field : 'calendar' }],

// Choose the Event fields to include in the exported file eventColumns : [ { text : 'Task', field : 'name' }, { text : 'Starts', field : 'startDate', width : 140 }, { text : 'Ends', field : 'endDate', width : 140 } ] } } } });

And how to call it:

calendar.features.excelExporter.export({
    filename : 'Export',
    exporterConfig : {
        columns : [{ text : 'Staff', field : 'name' }]
    }
})

This feature is disabled by default.

This class requires a 3rd party library to export to XLSX

Useful configs

Config Description
xlsProvider Provider class for generating XLS files
dateFormat Date format for exported date fields
exporterConfig Config for columns and fields to export

See also

  • Calendar — The Calendar whose data is exported
  • EventModel — The event model with fields available for export
No results

Properties

Properties are getters/setters or publicly accessible variables on this class
id: excelExporter

Source path

Calendar/feature/experimental/ExcelExporter.js

Demo

examples/exporttoexcel

Contents