exports data from the Gantt chart to Primavera P6

void exportToPrimaveraP6(object export);


exportobjectan object with export settings (see the details)



Related samples


This functionality is currently in Beta stage. The information given in this article may be substantially changed before the feature enters its stable stage.

This method is defined in the export extension, so you need to include it on the page:

<script src="https://export.dhtmlx.com/gantt/api.js"></script>

Read the details in the Export and Import from MS Project article.

The exportToPrimaveraP6() method takes the same parameters as exportToMSProject does:

  • name - (string) the name of the obtained file ('gantt.xml' by default).
  • auto_scheduling - (boolean) indicates the scheduling mode for tasks in the exported project. true will mark tasks as auto scheduled, false will mark tasks as manually scheduled (the default state).
  • skip_circular_links - (boolean) indicates whether the circular links will be removed or not (true - will be removed (the default mode), false - will not be removed).
  • project - (object) allows setting custom properties to the exported project entity.
  • tasks - (object) allows setting custom properties to the exported task items.
  • callback - (function) if you want to receive an url to download a generated XML, the callback property can be used. It receives a JSON object with the url property.
  • resources - (array) allows exporting the list of resources into an MS Project file.
  • server - (string) the API endpoint for the request. Can be used with the local install of the export service. The default value is https://export.dhtmlx.com/gantt.


The response will contain a JSON of the following structure:

   data: {},
   config: {},
   resources: [],
   worktime: {}
  • data - a gantt data object. Each task has the following properties: id, open, parent, progress, start_date, text, resource. Dates are stringified in the "%Y-%m-%d %H:%i" format.
  • config - a gantt configuration object with settings retrieved from the project file.
  • resources - an array of objects (each having the following properties: {id: string, name:string, type:string}) that represent the list of resources from the project file.
  • worktime - an object containing the working time settings from the project calendar.
See also
Back to top