Skip to main content

Import from MS Project

The functionality is available in PRO Edition only

PRO

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:

import { useRef } from "react";
import { Gantt } from "@svar/react-gantt";

function App() {
const api = useRef(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.current.exec("import-data", {
data: xml,
});
};
reader.readAsText(file);
}

return <Gantt apiRef={api} />;
}

Related sample: Export/import to MS project (client-side)

Related articles: