Skip to content

Import Microsoft Project XML and MPP into a React Gantt chart ​

The optional Microsoft Project adapter for RevoGrid Gantt imports Project XML and native MPP14 files. It exports Project XML. Review the conversion warnings before applying an import, especially if the schedule relies on custom calendars or resource assignments.

In the React example, you can preview the sample XML, apply it, edit a task, and export a fresh XML file from the updated schedule. Native MPP export is unsupported.

Try the sample Microsoft Project import ​

The hosted Microsoft Project demo runs conversion locally in the browser. Use its sample XML to inspect an import, edit the schedule, and export XML without setting up a backend.

The React example includes the import preview and the Apply and Cancel controls.

The converter is separate from the public Gantt trial package. The companion's setup instructions use the optional adapter built from that release's licensed source; they do not assume a public trial package exists for it. Configure access according to the Gantt installation guide.

Which Microsoft Project formats can you import and export? ​

Input or outputCurrent supportApplication response
Microsoft Project XMLImport and exportReview the mapped fields and warnings
MPP14Import onlyReview additional native-import losses
MPP8, MPP9, MPP12UnsupportedShow unsupported-mpp-version; ask for Project XML
Encrypted MPPUnsupportedShow encrypted-mpp-not-supported
Native .mpp exportUnsupportedOffer XML export

The file importer inspects the compound-document signature for native MPP rather than relying only on .mpp in the filename. A browser File supplies both text() and arrayBuffer(). A custom file-like object needs binary access for MPP; XML-only adapters can supply name and text().

An invalid native file produces invalid-mpp; invalid XML and an XML project without importable tasks have their own errors. Catch these errors and leave the current project intact. Do not silently interpret an unsupported file as an empty replacement project.

The Microsoft Project format reference documents this support matrix.

Parse first, then let the user apply ​

Use the framework-neutral converter for a review step:

ts
import { importMicrosoftProjectFile } from '@revolist/revogrid-gantt-msp';

const result = await importMicrosoftProjectFile(file, {
  projectId: 'machine-rollout',
  currency: 'EUR',
  timeZone: 'UTC',
});

// Store this in application preview state. Do not replace grid.source yet.
setPreview(result);

The result contains a ProjectSnapshot and structured warnings. Display the warnings beside task/dependency counts and an explicit Apply/Cancel choice. The complete React component also handles rejected files and prevents an older asynchronous parse from replacing a newer preview.

GanttMspImportPlugin.importFile() is useful when immediate application is wanted: it converts the file and applies the project. It is not a preview-only method. For the workflow in this article, the standalone converter gives the application control over when replacement happens.

On Apply, the companion passes the imported tasks through the React grid wrapper. It maps progressPercent to the task-row percentDone field and supplies ganttDependencies, ganttCalendars, ganttResources, ganttAssignments, and ganttBaselines. The project is mounted with a new React key when a replacement is accepted; ordinary renders retain its state.

See the complete ImportProject.tsx, including both review panels. The application owns the replacement decision, file retention, server authorization, and persistence. The converter owns format parsing and the supported mappings.

Verify the sample before trying a customer file ​

The companion includes a small authored XML fixture. Its expected import result is:

CheckExpected result
TasksFour: rollout summary, Commission machine, Write handover notes, Ready milestone
DependenciesTwo finish-to-start links
CalendarsOne generated Monday–Friday calendar
BaselinesThe first baseline for the handover task
Commission duration16 canonical hours
Commission progress50%
Import warningdefault-calendar-created

First preview the sample and cancel: no active project should be replaced. Preview it again and apply. Change Commission machine to Commission line A, then prepare and download XML. The exported task name should contain the edit. Reimport that XML to compare the supported fields.

This fixture demonstrates XML conversion. It is not evidence that every Microsoft Project MPP14 producer, every custom field, or a complex production schedule will round-trip correctly. Use representative customer files before making a migration commitment.

Which fields survive the conversion? ​

The current adapter has a narrower scope than the complete Microsoft Project model:

DataXML importNative MPP14 import
Task names, hierarchy, dates and durationsMappedMapped
Summary tasks and milestonesMappedMapped
FS, SS, FF and SF dependency relationshipsMappedMapped
Dependency lead/lagNot retained; lag becomes zeroNot retained; lag becomes zero
Completion progressMappedDefaults to zero
NotesMappedOmitted
First task baselineMapped when exposed by the XML converterFirst-baseline dates mapped
Additional baselinesNot retainedOmitted
Microsoft Project working calendarsReplaced by a standard calendarReplaced by a standard calendar
Resources and assignmentsNot imported by this adapterOmitted

XML is therefore not a lossless workaround for resource or calendar preservation. Native MPP returns unsupported-fields for its intentional omissions, while XML warns that a default calendar was created. The warning array is not a complete field-by-field compatibility report. Consult the mapping table even when there are few warnings.

The adapter works with a date-based schedule mapping. Do not promise preservation of every original intraday timestamp, custom field, constraint, cost, scheduling option, or Microsoft Project calculation merely because tasks appear in the grid. Review the scheduling compatibility guide separately from file-format support.

Rebuild calendars and assignments before trusting a schedule ​

A synthetic Monday–Friday calendar may give different effective dates from a source project with holidays, night shifts, or separate resource calendars. The companion enables excludeHolidaysFromDuration: true, so the active calendar participates in scheduling after Apply.

For a real migration, collect the original calendar definitions separately, recreate them, assign their IDs to tasks/resources, and compare the recalculated schedule. Import or reconcile resources and assignments through application data rather than assuming they arrived from the Project file. Compare milestones, task durations, progress, dependency relationships, and the final project finish against the source.

The working-calendar tutorial shows inherited weeks and exceptions. Resource leveling becomes meaningful only after the actual resources, capacities, and assignments are present.

Export the effective schedule after editing ​

Keep the imported snapshot separate from the current runtime state. Exporting the original result.project after a user edits the grid would produce stale dates or names.

The companion finds the current GanttPlugin and gets its project collections. It uses a temporary captureBaseline() result to overlay effective scheduled dates, durations, and progress on those collections. This capture does not add a persisted baseline; it supplies canonical-hour values after scheduling and summary rollup.

ts
import { GanttPlugin, type ProjectSnapshot } from '@revolist/gantt';

export async function currentSchedule(
  grid: HTMLRevoGridElement,
): Promise<ProjectSnapshot> {
  const runtime = (await grid.getPlugins()).find(
    (plugin) => plugin instanceof GanttPlugin,
  );
  const project = runtime?.getProjectSnapshot();
  if (!runtime || !project) throw new Error('The project is not ready.');

  // Capture is pure: it does not append a saved baseline to the project.
  // It gives us effective dates and canonical-hour durations after scheduling.
  const capture = runtime.captureBaseline();
  const scheduled = new Map(capture?.tasks.map((task) => [task.taskId, task]));
  return {
    ...project,
    tasks: project.tasks.map((task) => {
      const current = scheduled.get(task.id);
      return current
        ? {
            ...task,
            startDate: current.startDate,
            endDate: current.endDate,
            duration: current.duration,
            progressPercent: current.progressPercent,
          }
        : task;
    }),
  };
}

Then convert that current snapshot:

ts
import { exportMicrosoftProjectXml } from '@revolist/revogrid-gantt-msp';

const current = await currentSchedule(grid);
const exported = exportMicrosoftProjectXml(current);

// Present exported.warnings before offering exported.xml for download.
setExported(exported);

XML export remaps task IDs to numeric Project UIDs when necessary. It does not export resources, assignments, non-default calendars, or dependency lag; only the first baseline is considered. The resulting XML should be validated in the target application before it becomes a contractual schedule or the sole backup of a project.

Use the complete JSON project snapshot for your application's own persistence. XML is an interchange format with an explicit mapping boundary. Server saves still need authorization, revision checks, and recovery for failed requests; local conversion does not implement those behaviors.

The format reference and live demo, React Gantt integration, and Gantt product page provide the next steps for trying the workflow with your data.