After updating mpp file multiple times, task names and indentation are lost

Hi Kashif,

Also please note that after updating mpp file multiple times, task names and indentation are lost as in the following file:
https://drive.google.com/open?id=1HTmaHFSyeInP5VQZYpslCNiVEK4W5RCg

@bassimalrifai,

This different issue is splitted into a new thread.

You mentioned that updating sample project file “SimpleResources_Start.mpp” multiple times causes the task names and indentations to be lost. I have tried this scenario using Aspose.Tasks for Java 17.11 and loaded the file as follows:

Project proj = new Project("SimpleResources_Start.mpp");

However I am afraid to share that I get exception while loading this file. Could you please test this scenario at your end using latest version and share the feedback?

ExceptionWhileLoadingTheFile.zip (520 Bytes)

hi kashif,

the issue appears with the following scenario:

(1) update mpp file using aspose tasks “file1.mpp” and save it as “file2.mpp”.
(2) open the updated file “file2.mpp”, update is successful.
(3) update the updated file “file2.mpp” using the same code of step (1).
(4) names and indentations are lost.

** also all tasks have the same start date

@bassimalrifai,

As informed earlier, that when I load the project file first time using following code, it raises exception immediately, so I cannot update or save it.

Project proj = new Project("SimpleResources_Start.mpp");

Could you please check it once again by loading this project file and share the feedback? If it opens fine using Aspose, share the product version which you are using.

Share the complete code for re-producing the scenario and also inform us that what are the updates which you perform before saving it back for our reference.

Hi Kashif,

please try the above scenario using the following mpp file:
https://drive.google.com/open?id=1CxrnUbcLzEpLmrb1lgdRS1-fw7wdND-I

when I upload the file, I use the following code, to get the xml output of the file for my app:
https://drive.google.com/open?id=1kAXkcBA6Hu60lWcAM4HjJ5GrjRJEJgsk

when I want to update the mpp file before exporting it to user, I use the following code:
https://drive.google.com/open?id=1hm-Nq6_hLcAF-SUej9GJ5eY_B6heut2c

this scenario works fine at the first upload and update, but when i update the file second time the issue occurs.

@bassimalrifai,

Thank you for providing more information.

I have tested the scenario using following sample code where test3.mpp file is updated and saved as “testGo1.mpp” and then loaded this “testGo1.mpp” again. Same code is executed and new file “testGo2.mpp” is created. It can be seen that none of the task name is lost. Similarly all the indentations are intact and also start dates are different. Sample code and output files are attached here for your reference. Please give it a try and share the feedback.

Project proj = new Project("testGo1.mpp");
ChildTasksCollector collector = new ChildTasksCollector();
TaskUtils.apply(proj.getRootTask(),collector,0);
List<Task> tasks =  collector.getTasks();
for(Task tsk : tasks)
{
    tsk.set(Tsk.PERCENT_COMPLETE, 40);
}

proj.recalculate();
proj.save("testGo2.mpp", SaveFileFormat.MPP);

outputFiles.zip (75.9 KB)

I am still facing the issue from my side.

could it be an environment issue ?

I suspect 2 things, maybe it is related to the php/Java bridge issue or ms project version.

is it possible to check from your side running the sent code using the php/java bridge ?

what is the ms project version you have installed ? I have ms project professional 2016

thanks again

@bassimalrifai,

We are currently establishing php/java bridge environment at our end. Meanwhile, can you please share your output MPP file with us for our reference? We want to compare the results with ours for deciding if it is something at MSP 2016 end.

Hi Kashif,

please try the following, before saving “testGo1.mpp” to “testGo2.mpp”, please try to manually update “testGo1.mpp” file.

the issue appears when I update the file manually and then update it using aspose.

the issue appears with the following scenario:

(1) update mpp file using aspose tasks “file1.mpp” and save it as “file2.mpp”.
(2) open the updated file “file2.mpp”, update is successful.
(3) update the updated file “file2.mpp” manually using ms project.
(4) update the updated file “file2.mpp” using the same code of step (1).
(5) names and indentations are lost.

Hi Kashif,

I am now sure that this is ms project version issue.

the issue appears when modifying the file with ms project and saving the file, but when I save the file as “Microsoft Project 2007 (*.mpp)” the issue does not appear.

@bassimalrifai,

As requested earlier, please send us all the intermediate 03 files as follows for our reference as still issue is not re-produced by following the above steps. I am using test3.mpp file as input (called file1.mpp here).

  1. The updated file2.mpp using Aspose.Tasks
  2. Same file2.mpp after manual update by MS Project
  3. The second time updated file2.mpp using Aspose.Tasks

I will provide you the 3 files,

can you refer to me about your testing environment to simulate it from my side to be aligned with your environment ?

I am using ms project professional 2016 on windows 10 machine with aspose for Java version 17.11

@bassimalrifai,

I am using VS 2017, Microsoft Project 2010, Windows 7 and Aspose.Tasks for Java 17.11.