converts an XML or XER Primavera P6 file to JSON
config | object | an object with configuration properties of an imported file |
gantt.importFromPrimaveraP6({
data: file,
taskProperties: ["Notes", "Name"],
callback: function (project) {
if (project) {
gantt.clearAll();
if (project.config.duration_unit) {
gantt.config.duration_unit = project.config.duration_unit;
}
gantt.parse(project.data);
}
}
});
The method requires HTML5 File API support.
This method is defined in the export extension, so you need to activate the export_api plugin. Read the details in the Export and Import from Primavera P66 article.
If you use the Gantt version older than 8.0, you need to include the https://export.dhtmlx.com/gantt/api.js on your page to enable the online export service, e.g.:
<script src="codebase/dhtmlxgantt.js"></script>
<script src="https://export.dhtmlx.com/gantt/api.js"></script>
The method takes as a parameter an object with configuration properties of an imported file:
The response will contain a JSON of the following structure:
{
data: {},
config: {},
resources: [],
worktime: {}
}