PrimaveraPMFileReader does not read PercentageComplete
Multi platform library to read and write schedule data
Brought to you by:
joniles
PrimaveraPMFileReader throws exception on reader.read, because the field PercentageComplete is null, even though it obviously is in the input file (see attached file). the input file I exported before with PrimaveraPMFileWriter! also see attached screenshots of exception in Netbeans IDE.
AbstractProjectReader reader = new PrimaveraPMFileReader();
ProjectFile projectFile = reader.read(inputFile);
Exception occurs in PrimaveraPMFileReader.java
Line 463: task.setPercentageComplete(NumberHelper.getDouble(row.getPercentComplete().doubleValue() * 100.0));
because row.getPercentComplete() delivers null
It seems for me that the problem is that on export in PrimaveraPMFileWriter you write "DurationPercentComplete":
line 433: xml.setDurationPercentComplete(getPercentage(mpxj.getPercentageComplete()));
BUT on import on PrimaveraPMFileReader you read "PercentageComplete"
line 464: task.setPercentageComplete(NumberHelper.getDouble(row.getPercentComplete().doubleValue() * 100.0));
which is null because on export before only "DurationPercentComplete" was written
If I would change the line in reader to row.getDurationPercentComplete() instead of row.getPercentComplete(), it would read something (I m not sure if this is the correct solution)
I've updated the code in git to use duratio percent complete consistently. This should resolve the issue you reported.