MPP from XML

I want to create a MPP file from xml, do you HAVE ANY MACHENISHM TO CHNAGE THE XML FILE TO MPP FILE.

I GUESS NO.SO I AM READING THE XML FILE AND WRITING THE NEW MPP FILE GIVEN VALUE FROM XML WHICH I HAVE ALREDAY READ(SAVED IN DATATABLE).

FILE WHCIH I AM CREATING CONTAIN 5000 TASKS IT TAKES MORE THEN 10 MIN.

ANY WAY TO REDUCE THE TIME.

PLEASE HELP

Hi Ashutosh,


Thanks for writing to Aspose.Tasks support team.

Currently Aspose.Tasks does not support saving XML to MPP directly. However you may use blank template MPP file, add tasks and save it to disc.

For testing the delay factor, could you please provide us the sample XML file containing 5000 tasks along with the console application used for this testing. It will help us to analyze the problem and provide assistance.

Thanks for your reply.

please find my code and steps which I am following.

Sorry for my late reply , I was busy with some other stuff.
Please find the below item
1-I am using a MPP file as a template, as we can not write only update to a MPP file.
2-Then I am reading the xml file, for storing the data in dataset and updating the MPP template.
please find the two aspx pages for the same.
3- Since we can only update, and then I am removing the extra tasks.

Hi Ashutosh,


Thanks for writing back again.

I could not find any aspx pages in the attachments. Could you please send us the console application which can be used to re-produce the issue?

Hi Ashutosh,


While processing your sample source file, we were facing TaskWritingException during saving it to disc. This issue was logged in our issue tracking system under issue id: TASKS-33345 which our development team has worked on and fix will be provided in the upcoming product release of Aspose.Tasks for .NET 5.5.0.

I would also like to share that the issue of slow output file generation during creation of MPP from XML has also been fixed and will be part of upcoming product release.

In addition, an enhancement ticket with id: TASKS-33346 has been logged in our issue tracking system for providing a public method that can copy a project to another project file with a single API call. I have linked this thread with both these issues and you will be notified automatically once the fix version is available.

The issues you have found earlier (filed as TASKS-33345;TASKS-33346) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

HI,

For creating Mpp file from xml I am using a template and writing the direct value,

All I sworking well, next week we had plan to purchase the software, suddenly I got an issue which is cricytical in our project.

I am not able to update the start and finish date of a existing Task.

I am using the below code. please help .

string newProject = "C:\\Dsoframer\\Mpp\\A.mpp
ProjectReader reader = new ProjectReader();
Project project = reader.Read(newProject);
project.StartDate = new DateTime(2012, 06, 29, 8, 0, 0);
ChildTasksCollector collector = new ChildTasksCollector();
//Use TaskUtils to get all children tasks in RootTask
TaskUtils.Apply(project.RootTask, collector, 0);
//Parse all the recursive children
foreach (Task tsk in collector.Tasks)
{
tsk.Start = DateTime.Parse("20-Aug-2013 5:00 PM");
tsk.Finish = DateTime.Parse("20-Aug-2013 5:00 PM");
}
string testFile = "C:\\Dsoframer\\Mpp\\A1.mpp";
project.CalcTaskIds();
project.CalcTaskUids();
project.UpdateReferences();
project.Save(testFile, Aspose.Tasks.Saving.SaveFileFormat.MPP);
string newProject = "C:\\Dsoframer\\Mpp\\A.mpp
ProjectReader reader = new ProjectReader();
Project project = reader.Read(newProject);
project.StartDate = new DateTime(2012, 06, 29, 8, 0, 0);
ChildTasksCollector collector = new ChildTasksCollector();
//Use TaskUtils to get all children tasks in RootTask
TaskUtils.Apply(project.RootTask, collector, 0);
//Parse all the recursive children
foreach (Task tsk in collector.Tasks)
{
tsk.Start = DateTime.Parse("20-Aug-2013 5:00 PM");
tsk.Finish = DateTime.Parse("20-Aug-2013 5:00 PM");
}
string testFile = "C:\\Dsoframer\\Mpp\\A1.mpp";
project.CalcTaskIds();
project.CalcTaskUids();
project.UpdateReferences();
project.Save(testFile, Aspose.Tasks.Saving.SaveFileFormat.MPP);

Hi Ashutosh,

Could you please confirm to us if you are getting this issue using the latest version of Aspose.Tasks for .NET 5.5.0? I would also request you to please provide us your sample files so as we can investigate this issue at our end and assist you further.

Yes , I have downloaded the latest dll version 5.5, still I am getting the issue.

and you can copy and past the code directly from my earlier post.

Please help me , its become very critical now.

Hi Ashutosh,

Please spare us a little time to investigate this issue further. We’re currently investigating this issue and will share our findings with you soon. Could you also please provide us with your sample file here so as we can carry out our testing with it as well and forward to development team in case of an API bug.

Hi Ashutosh,


Please add the code for recalculating the tasks after you update the start and finish dates. You can do it either in your foreach loop for each task or after the foreach loop for the root task. Please let us know your feedback then.

Sample Code:

foreach (Task tsk in collector.Tasks)
{
tsk.Start
=
DateTime.Parse(“20-Aug-2013
5:00 PM”
);
tsk.Finish = DateTime.Parse(“20-Aug-2013 5:00 PM”);
Task.Recalculate(tsk);
}

or

foreach (Task tsk in collector.Tasks)
{
tsk.Start = DateTime.Parse(“20-Aug-2013 5:00 PM”);
tsk.Finish = DateTime.Parse(“20-Aug-2013 5:00 PM”);
}

Task.Recalculate(destinationProject.RootTask);


The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.