Excel Export in JavaScript Gantt Chart Control

18 Nov 20182 minutes to read

The JavaScript Gantt Chart control supports exporting project data to Excel and CSV formats, enabling seamless sharing, reporting, and offline analysis.

To enable Excel or CSV export functionality, set the allowExcelExport property to true and inject the ExcelExport service into the control’s providers array.

You can trigger export operations using the excelExport or csvExport methods, typically within the toolbarClick event.

Binding custom data source while exporting

You can bind a custom data source for Excel or CSV export in the JavaScript Gantt Chart control by assigning it dynamically before the export begins. To achieve this, set the required data to the dataSource property within the ExcelExportProperties configuration.

Exporting with cell and row spanning

To export merged cells and rows in Excel or CSV files using the JavaScript Gantt Chart control, handle the excelQueryCellInfo event and apply rowSpan and colSpan during the export process. The queryCellInfo event can be used to customize cell rendering within the Gantt view.

Show spinner while exporting

To indicate progress during the export operation in the JavaScript Gantt Chart control, use the showSpinner method within the toolbarClick event when initiating Excel or CSV export. After the export process completes, hide the spinner by calling the hideSpinner method inside the excelExportComplete event.

Exporting with custom date format

To apply a custom date format to columns during Excel or CSV export in the JavaScript Gantt Chart control, define the desired format using the format property in the column configuration.

Exporting multiple Gantt charts

The JavaScript Gantt Chart control supports exporting multiple Gantt Charts either into a single worksheet or across separate sheets when generating Excel or CSV files.

Same sheet

To export multiple datasets into a single worksheet, set multipleExport.type to AppendToSheet within the ExcelExportProperties configuration. To add spacing between datasets, define the number of blank rows using the multipleExport.blankRows property.

By default, multipleExport.blankRows value is 5.

New sheet

To export each Gantt to a separate worksheet, set multipleExport.type to NewSheet in the ExcelExportProperties configuration. This ensures each dataset is placed on its own sheet.

Export Gantt data as a Blob

To export Gantt data as a Blob object for advanced processing or custom download workflows, set the isBlob parameter to true in the excelExport or csvExport method. Use the excelExportComplete event to access the Blob and implement custom logic.