Import from MS Project
PRO
The functionality is available in PRO Edition only
You can import MS Project XML data to Gantt, provided that you handle file upload and read file contents as text. Then you can send the resulting XML string to the import-data action | PRO feature that parses it to Gantt tasks and links:
<script setup>
import { ref } from "vue";
import { Gantt } from "@svar/vue-gantt";
const api = ref(null);
function importMSProject() {
// your uploader control
const file = document.getElementById("import-file").files[0];
const reader = new FileReader();
reader.onload = e => {
const xml = e.target.result;
api.value.exec("import-data", {
data: xml,
});
};
reader.readAsText(file);
}
</script>
<template>
<Gantt ref="api" />
</template>
If the file contains resources and assignments, they are imported as well and replace the current resources and assignments of Gantt. Only work resources are imported: material and cost resources, and their assignments, are skipped.
Related sample:
Related articles: