Gantt Exporting services

15 Mar 20186 minutes to read

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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and hidden column.

Type2:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be passed to export
datasource object It holds the data to be exported in an 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, and hidden column.

Type3:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be passed to export
datasource object It holds the data to be exported in an 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 be downloaded. It can be the local or server machine file path.

Type4:

Name Type Description
GanttProperties Object It takes Gantt model properties that should be passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and hidden column.
multipleExport Boolean Is a boolean argument, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends 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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and 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, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends 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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and 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 be downloaded. It can be the local or server machine file path.
multipleExport Boolean Is a boolean argument, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends 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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and hidden column.
Workbook Object It specifies multiple exporting in which workbook file export should append; it holds the internally stored excel files, which were exported previously.
multipleExport Boolean Is a boolean argument, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends 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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and 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 multiple exporting in which workbook file export should append; it holds the internally stored excel files, which were exported previously.
multipleExport Boolean Is a boolean argument, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends 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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and 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 be downloaded. It can be the local or server machine file path.
Workbook Object It specifies multiple exporting in which workbook file export should append; it holds the internally stored excel files, which were exported previously.
multipleExport Boolean Is a boolean argument, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends 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 passed to export
datasource object It holds the data to be exported in an Excel
GanttExportSettings object Returns the exporting settings like unicode support, columns fit to width, and 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, the value `false` specifies that the exporting is completed and downloaded, and the value `true` specifies the export Gantt internally and appends something else to it before download starts.
Workbook Object It specifies multiple exporting in which workbook file export should append; it holds the internally stored excel files, which were 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 to a new sheet
headerText String headerText is to specify the title for export workbook.

Request

  • JAVASCRIPT
  • <body ng-controller="GanttCtrl">
       <!--Add  Gantt control here-->    
       <div id="GanttContainer" ej-gantt
          //...
          e-toolbarclick="toolbarClick" 
          >
       </div>
      <script>
       function toolbarClick(args){
             this.exportGrid = this["export"];
            if (args.itemName == "Excel Export") {
                this.exportGrid('http://js.syncfusion.com/ejServices/api/JSGanttExport/ExcelExport', "", false);
                args.cancel = true;
            }      
       }
        angular.module('listCtrl', ['ejangular'])
            .controller('GanttCtrl', function($scope) {
                //...
                $scope.toolbarClick = "toolbarClick";
            });
    </script>
    </body>

    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 taskCollection = new TaskDetailsCollection();
    
    IEnumerable<TaskDetails> result = taskCollection.GetDataSource();
    
    exp.Export(gridProperty, result, "ExcelExport.xlsx", ExcelVersion.Excel2010, new GanttExportSettings() { Theme = ExportTheme.FlatAzure });
    
    }