We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Load XML into Ms Project with Aspose Example

Hi,

We are evaluating the Aspose.Tasks library and I ran into this problem using the example provide by Aspose.

For this example (see Capture1.JPG)
\src\programmersguide\workingwithprojects\writemppprojectsummary\java\WriteMPPProjectSummary.java,

I click on “Run Example”, the new MPPAspose.xml is created/updated in src\programmersguide\workingwithprojects\writemppprojectsummary\data.

I open the MS Project 2010 to load the XML file, but got “The start of Task 10 is before Project Start” error. I clicked OK, the tasks are loaded. however, the dates for all tasks are messed up. (see Capture2.JPG)

Do you have a working example where XML tasks can be loaded into MS Project successfully?

Thanks!


Hi Ying,


Thank you for contacting Aspose support team.

Aspose.Tasks library is freely available for testing however there are few limitations which can be avoided by using license. Here the output XML is created without the license therefore all the dates are changed to year 2000. For testing the library without any limitation you may please get the temporary license.

Following is a sample code which can be used to write summary to project however the dates will change if license is not used.


Project project = new Project(“project.mpp”);

//Set some summary information about the project
project.setAuthor(“Muhammad Sabir”);
project.setLastAuthor(“Sergey Polshkov”);
project.setRevision(15);

java.util.Calendar cal = java.util.Calendar.getInstance();
cal.set(2014,2,15,0,0,0);
project.setCreationDate(cal.getTime());
cal.set(2014,3,15,0,0,0);
project.setKeywords(“MPP Aspose”);
cal.set(2014, 3, 16,0,0,0);
project.setLastPrinted(cal.getTime());
project.setSubject(“Aspose Subject”);
project.setTemplate(“Aspose Template”);
project.setComments(“Aspose Comments”);

//Save the Project back in MPP format
project.save(“MPPAspose.xml”, SaveFileFormat.XML);

//Display result of conversion.
System.out.println(“Process completed Successfully”);