Reading MS Project Files

The used Java library MPXJ Version 4.3 is able to read MS Project files up to Version 2010.

1. Create a Report with a Stages Data Source

2. Create an Artifact and create an Artifact Instance (File) in Stages by uploading a MS Project file.

3. Create a Data Set with the following result columns:

NameType
taskString
IDString
startDate
finishDate
workString

4. Include a Current metric like metric]Dashboard

5. Click on the Data Set on Preview Results

Example MS Project Extraction Script

function dumpValues(filename, filestream) {
 if (filestream !=null) {
 reader = ProjectReaderUtility.getProjectReader(filename);
 projectfile = reader.read(filestream);

 if (projectfile!= null) {
 var Tasks = projectfile.getAllTasks().toArray();
 for (jj=0; jj<Tasks.length; jj++ )
 {
 task = Tasks[jj];
 dataset.setColumnValue("ID",task.getID() );
 dataset.setColumnValue("tasks",task.getName() );
 dataset.setColumnValue("tasks",task.getName() );
 dataset.setColumnValue("start",task.getStart() );
 dataset.setColumnValue("finish",task.getFinish() );
 dataset.setColumnValue("work",task.getWork() );
 dataset.storeResultRow();
 }
 }
  }
}
var ArtifactName = "Project Metric Example";
var ArtifactInstanceName = "Project_Metric_example.mpp";
var process = stages.getCurrentProcess();
var artifacts = process[0].getEntities("containsArtifact@SYSTEM");
for each (artifact in artifacts) {
 if (artifact.getProperty("DisplayName") == ArtifactName) {
 var artifacts_instances =
 artifact.getEntities("containsInstance@SYSTEM");
 for each (artifacts_instance in artifacts_instances) {
 if (artifacts_instance.getProperty("LogicalName") ==
 ArtifactInstanceName) {
 var filestream = artifacts_instance.getProperty("FileStream");
 dumpValues(artifacts_instance.getProperty("PhysicalName"),
 filestream);
 }
 }
 }
}