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

Free Support Forum - aspose.com

CalculationMode.None ..... Is a Project.Recalculate required

Hi,


With performance in mind we have set the Project CalculationMode to None and are setting all the necessary fields values via code. As a result of having the CalculationMode set to None we have to call the Recalculate method. If we do not call the Recalculate method, we end up with a MS Project file that opens as a new project with no data (the save does not end in error, it just seems as though there is something wrong with the project, even though we get no corruption error. I attempt to open a result.mpp file but opens as Project1.mpp).

if (project.CalculationMode == CalculationMode.None)
{
project.Recalculate();
}

MPPSaveOptions mppSaveOptions = new MPPSaveOptions();

mppSaveOptions.WriteViewData = true;

project.Save(@“C:\Aspose_WBS\Live\result.mpp”, mppSaveOptions);

Is there an Aspose.Tasks configuration available that will allow us to have CalculationMode set to None, NOT call the Recalculation method, still have all tasks written to the MS Project file and then let MS Project preform the required calculation on open (this will ultimately roll the child task hours, duration’s, etc. up to the applicable parents)?

We are using Aspose.Tasks 16.11.1.0, MS Project 2010 and VS 2010.

Thanks, Calvin

Hi Calvin,


Thank you for writing to Aspose support team again.

I have checked the documentation but could not find any option where Recalculate() function can be skipped before saving the project file while using CalculationMode.None. You may please use Recalculate() function before saving the project to get the appropriate results.

Please feel free to write us back if you have any other query in this regard.