Export and import from MS Project in DHTMLX Gantt Chart

| Comments (16)

What if we told you that export to/import from MS Project is available in dhtmlxGantt? “Finally!” would be a pretty fair reaction of many users. So now you are able to import and export a Gantt Chart from MS Project as easy as to write an admiring comment to this blog post!

Export to MS Project

Your dhtmlxGantt can be exported into XML MS Project file, which will preserve all tasks, relations and worktime settings, so then you can easily roll out the Gantt chart project in Microsoft Office Project.

View sample

Import from MS Project

The import service enables to convert XML or MPP MS Project files into JSON that will be compatible with dhtmlxGantt and will contain all tasks, relations, working days and times settings, and some optional MS project values. When dhtmlxGantt receives this JSON, it can be loaded into the gantt directly on the client (as you can see in this sample), or JSON can be received on the server to make an import to the database.

import from MS Project to Gantt chart

View sample

For now, the export service is available online only. There is no need in any extra settings in order to start using it. All the attendant configurations are described in Export and import from MS Project section in our docs.


  1. masdju June 21, 2016 at 12:45 pm

    Great! Good Job…

    • Maria (DHTMLX team) June 21, 2016 at 1:32 pm

      Thanks! ;)

  2. yaser June 26, 2016 at 11:55 pm

    It is amazing
    Thank you

  3. Rim September 26, 2016 at 1:39 pm

    The sample is not working. null project in importFromMSProject callback

    • Aras Kairys (DHTMLX team) September 26, 2016 at 8:25 pm

      Hi Rim,
      The export service seems working ok, however, the demo file attached to this demo appears to be corrupted. If you use a different project file, for example, this one https:// s3.amazonaws.com/uploads.hipchat.com/15721/63476/cs3tLIaU2jnIln4/Simple_project_plan.mpp everything should work ok.
      Thanks for reporting and sorry for the inconvenience. We’ll check what’s happened and will update the demo as soon as possible.

  4. Sergio Negri December 19, 2016 at 1:21 pm

    I know resources are not natively supported in dhtmlxgantt (you cannot assign tasks to people). I know there is a workaround. But I was wondering what happens when you import MPP files into dhtmlx: is the information on resource assigned to task simply ignored, or is it put somewhere in the json so that it can be retrieved and managed (albeit in a custom way)?
    Thank you!

    • Aras Kairys (DHTMLX team) December 19, 2016 at 5:35 pm

      Hi Sergio,
      The import service return a general info of resources and assignments, so you can use it with custom code (but the scheduler doesn’t use this info by default). The service returns a list of resources in the “resources” property of the response object http://screencast.com/t/oZd8rwWOUbu – it’s an array of {id:string, name:string} objects.
      In its turn, each task that comes from the import service has an array of resource ids attached to it:

  5. Chris March 7, 2017 at 7:01 pm

    If you have time can you guys change something. Your URL reference redirects to https, BUT the javascript include is http://export.dhtmlx.com/gantt/api.js. That causes a blocked-mixed content. Your include should be https://export.dhtmlx.com/gantt/api.js.

    (When I try from my server I am getting an empty xml file. I wanted to test with your example on your server.)

  6. Christian March 28, 2017 at 5:57 pm

    This sample dont work for me, is it still useable ?

    • Aras Kairys (DHTMLX team) March 28, 2017 at 6:09 pm

      Hi Christian,
      Does it work with this file: https:// s3.amazonaws.com/uploads.hipchat.com/15721/63476/cs3tLIaU2jnIln4/Simple_project_plan.mpp ?
      Probably, the demo file on the website got corrupted

  7. Nicholas Barcelos September 16, 2017 at 12:43 am

    there is any way of reading a specific file from a url instead from getting from a form?

    I tried some workaround but even getting the file as a blob and making a new file object from it gives a error:

    Uncaught TypeError: formData.append is not a function
    at sendImportAjax (api.js:789)
    at Object.gantt.importFromMSProject (api.js:836)

    //… and so on

    • Nicholas Barcelos September 16, 2017 at 1:07 am

      I found a solution based on the example is not great but works:

      function blobToFile(blob, filename){
      return new File([blob], filename, {type: blob.type, lastModified: Date.now()});

      var request = new XMLHttpRequest();
      request.open(‘GET’, my_file_url, true);
      request.responseType = ‘blob’;
      request.onload = function() {
      var file = blobToFile(request.response,”project.mpp”);

  8. Nicholas Barcelos September 18, 2017 at 8:15 pm

    here the example works great but when you download and test the same example from the samples it gives wrong values on duration and end date.

    • Aras Kairys (DHTMLX team) September 22, 2017 at 2:03 pm

      Hi Nicholas,
      Unfortunately, it’s hard to say what is the cause of the issue.
      Please create a topic with your technical questions on our forum: https://forum.dhtmlx.com/
      Any demo or code sample would be very helpful.

  9. Neil October 20, 2017 at 6:14 pm

    Is there a way to import/export to MS Project locally, without using the online service? I would like to use that feature by my requirements do not allow me to send the data to a third party service.

    • Aras Kairys (DHTMLX team) October 23, 2017 at 1:38 pm

      Hi Neil,
      Please check our reply in the support system.
      If you have any questions, you can contact me directly via support@dhtmlx.com

Leave a Reply