Gantt Exporting services

Description

Find the Gantt exporting type below,

  • Excel Export.

Excel export

URL

http://js.syncfusion.com/ejServices/api/JSGanttExport/ExcelExport

Parameter

Type1:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.

Type2:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
excelName String It specifies the file name an extension to be downloaded
excelVersion String Excel version in which workbook should download
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.

Type3:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
excelName String It specifies the file name and extension to be downloaded
excelVersion String Excel version in which workbook should download
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
filePath String With this parameter you can set the location where the exporting file should downloaded. It can be local or server machine file path.

Type4:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append it to something else before download starts.
headerText String headerText is to specify the title for export workbook.

Type5:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
excelName String With this parameter you can set the downloaded file name. By default it is set to “Export”
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append something else to it before download starts.
headerText String headerText is to specify the title for export workbook.

Type6:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
excelName String With this parameter you can set the downloaded file name. By default it is set to “Export”
filePath String With this parameter you can set the location where the exporting file should downloaded. It can be local or server machine file path.
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append something else to it before download starts.
headerText String headerText is to specify the title for export workbook.

Type7:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
Workbook Object It specifies in case of multiple exporting, in which workbook the file export should append, it holds the internally stored excel files which is exported previously.
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append something else to it before download starts.
headerText String headerText is to specify the title for export workbook.

Type8:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
excelName string With this parameter you can set the downloaded file name. By default it is set to “Export”.
Workbook Object It specifies in case of multiple exporting, in which workbook the file export should append, it holds the internally stored excel files which is exported previously.
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append something else to it before download starts.
headerText String headerText is to specify the title for export workbook.

Type9:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
excelName string With this parameter you can set the downloaded file name. By default it is set to “Export”.
filePath String With this parameter you can set the location where the exporting file should downloaded. It can be local or server machine file path.
Workbook Object It specifies in case of multiple exporting, in which workbook the file export should append, it holds the internally stored excel files which is exported previously.
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append something else to it before download starts.
headerText String headerText is to specify the title for export workbook.

Type10:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be pass to exporting
datasource object It holds the data to be exported in Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, hidden column.
excelName string With this parameter you can set the downloaded file name. By default it is set to “Export”.
multipleExport Boolean Is a boolean argument, and value `false` specifies the exporting is completed and download it, value `true` specifies the export Gantt internally and append something else to it before download starts.
Workbook Object It specifies in case of multiple exporting, in which workbook the file export should append, it holds the internally stored excel files which is exported previously.
MultipleExportType Object It specifies in case of multiple export, it returns the exporting type whether the file should append to the sheet or it should export in new sheet
headerText String headerText is to specify the title for export workbook.

Request

  • javascript
  • <ej-gantt
        //...
        [toolbarSettings]= "toolbarSettings"
        (toolbarClick)="toolbarClick($event)">
    </ej-gantt>
  • javascript
  • import {Component} from '@angular/core';
    
    @Component({
        selector: 'ej-app',
        templateUrl: 'app/app.component.html',
    })
    export class AppComponent {
        public toolbarSettings: any;
        constructor() {
    
            this.toolbarSettings = {
                showToolbar: true,
                toolbarItems: [
                    ej.Gantt.ToolbarItems.ExcelExport,
                    ej.Gantt.ToolbarItems.PdfExport
                ]
            }
    
        }
        toolbarclick(sender) {
            var id = $(sender.currentTarget).attr("id");
            var gantt = $("#GanttControl").ejGantt("instance");
            gantt.exportGrid = gantt["export"];
            if (sender.itemName == "Excel Export") {
                gantt.exportGrid('http://js.syncfusion.com/ejServices/api/JSGanttExport/ExcelExport', "", false);
                sender.cancel = true;
            }
        }
    }

    Following example will take part in the project service

    public void ExcelExport()
    
    {
    
    string gridModel = HttpContext.Current.Request.Params["GanttModel"];
    
    GanttProperties gridProperty = ConvertGridObject(gridModel);
    
    ExcelExport exp = new ExcelExport();
    
    TaskDetailsCollection tc = new TaskDetailsCollection();
    
    IEnumerable<TaskDetails> result = tc.GetDataSource();
    
    exp.Export(gridProperty, result, "ExcelExport.xlsx", ExcelVersion.Excel2010, new GanttExportSettings() { Theme = ExportTheme.FlatAzure });
    
    }