Export Excel and PDF not exporting - Good afternoon My export excel button is not working. Opens a page in the browser saying that it does not support the Get method. I did the test with the example that is in the documentation and it worked. Can you help me with that? Is there any property in my chart that is preventing export? Thanks


var data = [{
        taskID: 7,
        taskName: "FAMÍLIA XYZ",
        taskType : ej.Gantt.TaskType.FixedWork ,
        startDate: "10/02/2020",
        endDate: "10/06/2020",
        duration: 60,
        isMileStone: false,
        subtasks: [
            {
                taskID: 2,
                taskName: "Software Specification",
                startDate: "10/02/2020",
                endDate: "12/05/2020",
                notesContent: "we can show additional information here",
                duration: 4,
                progress: "60",
               // isMileStone: true,
                resourceId: [2]
            },
            {
                taskID: 3,
                taskName: "Develop prototype",
                startDate: "10/02/2020",
                endDate: "12/02/2020",
                duration: 4,
                progress: "70",
                resourceId: [3]
            },
            {
                taskID: 4,
                taskName: "Get approval from customer",
                startDate: "12/02/2020",
                endDate: "14/02/2020",
                duration: 2,
                progress: "80",
                predecessor: "3FS,2FF",
                resourceId: [1]
            },
            {
                taskID: 5,
                taskName: "Design complete",
                startDate: "15/03/2020",
                endDate: "15/04/2020",
                duration: 30, //seria uma tarefa milestone. a duração não pode ser alterada
                predecessor: ""
            }
        ]
    }];

    var projectResources =[{
        resourceId: 1,
        resourceName: "Project Manager"
 },{
        resourceId: 4,
        resourceName: "Testing Engineer"
    }];

 $(function() {
         $('#ganttContainer').ejGantt({
        dateFormat: "dd/MM/yyyy",
        isResponsive: true,
          dataSource: data, //Provides data source for Gantt
            taskIdMapping: "taskID", //Provide name of the property which contains task id in the data source
            taskNameMapping: "taskName", //Provide name of the property which contains task name in the data source
            startDateMapping: "startDate", //Provide name of the property which contains start date of the task in the data source
            durationMapping: "duration", //Provide name of the property which contains duration of the task in the data source
            progressMapping: "progress", //Provide name of the property which contains progress of the task in the data source
            notesMapping: "notesContent",
            predecessorMapping:"predecessor" ,// Predecessor editing
            childMapping: "subtasks", //Provide name of the property which contains subtask of the task in the data source
           resourceInfoMapping: "resourceId", //Field name which contains resource details for the task
     resourceNameMapping: "resourceName",//resource Name mapping
        resourceIdMapping: "resourceId",//resource Id Mapping
        resources: projectResources,//resource collection dataSource

            create: function () {
                this.showCriticalPath(true);
            },
            load: load,
            scheduleHeaderSettings:{
            weekendBackground : "#F2F2F2",
          weekHeaderFormat : "MMM dd , yyyy"
              },

           toolbarSettings: {
        showToolbar: true,
        toolbarItems: [
            ej.Gantt.ToolbarItems.Search,
            ej.Gantt.ToolbarItems.ExcelExport,
             ej.Gantt.ToolbarItems.PDFExport,
        ],
      },

    toolbarClick: toolbarClick,

      allowGanttChartEditing:true, //enable the taskbar editing

      editSettings: {
          // allowAdding: true,
                    allowEditing: true,
                   allowDeleting: true,
                   allowTaskbarEditing: true,
               // showDeleteConfirmDialog: true,
                   mode: 'Dialog'
        },
     allowSelection: true,

         columns: [
        { field: 'taskID',  headerText: 'ID', textAlign: 'Left', width: '300',  mappingName: "taskID"},
        { field: 'name', headerText: 'Tarefa', width: '200', minWidth: '150', mappingName: "taskName",  maxWidth: '250', editType: "stringedit"  },
        { field: 'inicio', headerText: 'Data Inicial',mappingName: "startDate",  width: '150', editType: "datePicker"   },
        { field: 'fim', headerText: 'Data Final',mappingName: "endDate",  width: '150', editType: "datePicker"   },
        { field: 'duracao', headerText: 'Duração', width: '100', minWidth: '50',mappingName: "duration", maxWidth: '200'},
        { field: 'progress', headerText: 'Progresso',mappingName: "progress",  width: '150'  },
        { field: 'notesContent', headerText: 'Obs', width: '200',  mappingName: "notesContent"  },
        { field: 'predecessor', headerText: 'Predecessores', width: '200',  mappingName: "predecessor"  },
        { field: 'resourceId', headerText: 'Recursos', width: '200',  mappingName: "resourceId"  },
    ],

        actionComplete: function (args) {
console.log(args)
//console.log(args.data.length)
                if (args.requestType === "recordUpdate") {
                  var encoded = JSON.stringify(args.data.item),
    data = encoded;
    console.log('encoded  '  +data)
                    for (var i = 0; i < args.updatedRecords.length; i++) {
                        var id = args.updatedRecords[i].item.taskID;
                        var start = args.updatedRecords[i].item.startDate;
                        var end = args.updatedRecords[i].item.endDate;
                       // var predecessors = args.data.item[i].Predecessor;
                          console.log('Updates na taskID  '+ id)
                        //save changes to the database
                      // sendData(id, start, end, predecessors);
                    }
                }

                if(args.requestType === "drawConnectorLine"){
       console.log('predecessor  '  +args.toItem.taskId)
       console.log('fromItem   '   + args.fromItem.taskId )
                }
               if(args.requestType == "openEditDialog") {
                console.log('oi')
         var tasknameField = (document.getElementById("EditingTaskName")).ej2_instances[0];
            tasknameField.enabled = false; //.... Disabled TaskName field from editing
      }
            },
           projectStartDate: new Date('01/02/2020'),
            projectEndDate: new Date('15/06/2020'),

        });
     });

function toolbarClick(args) {
    var id = $(args.currentTarget).attr("id");
    this.exportGantt = this["export"];

    if (id == "GanttContainer_pdfExport") {
        this. exportGantt("http://js.syncfusion.com/demos/ejServices/api/Gantt/PdfExport", "", false);
            args.cancel = true;
        }

        if (id == "GanttContainer_excelExport") {
            this. exportGantt("http://js.syncfusion.com/demos/ejServices/api/Gantt/ExcelExport", "", false);
                args.cancel = true;
        }
}


1 Reply 1 reply marked as answer

GM Gopinath Muniraj Syncfusion Team July 16, 2020 04:44 PM UTC

Hi Carmem, 
Thanks for contacting Syncfusion support. 
We have analyzed your query. Your issue is due to you are using our ej-services, which we created for the online demo samples. If you want to export the client-side data, you should create separate service. 
Please refer this KB link, 
Please revert us if you need any further details on this. 
Thanks, 
Gopinath M 


Marked as answer
Loader.
Up arrow icon