Hi,
I’m adding an extended attribute to a MPP file (Using Duration1 for this example). The field is added to the MPP file however not all attribute settings are retained (Calculation Type, Rollup Type and Duration Format). Am I missing something in my code that will carry these settings though to the new MPP file (New Project 2010.mpp and result.mpp files have been attached)?
See sample code below:
Project project = new Project("New Project 2010.mpp");
//Duration 1
ExtendedAttributeDefinition myTaskDurattr = new ExtendedAttributeDefinition();
myTaskDurattr.Alias = "New Duration";
myTaskDurattr.CfType = CustomFieldType.Duration;
myTaskDurattr.FieldId = ExtendedAttributeTask.Duration1.ToString("D");
myTaskDurattr.CalculationType = CalculationType.Rollup;
myTaskDurattr.RollupType = RollupType.Sum;
myTaskDurattr.ElementType = ElementType.Task;
project.ExtendedAttributes.Add(myTaskDurattr);
// Add new task and assign attribute value
Task task = project.RootTask.Children.Add("New task");
ExtendedAttribute taskAttr = myTaskDurattr.CreateExtendedAttribute();
taskAttr.DurationFormat = TimeUnitType.Hour;
taskAttr.Value = "PT2H0M0S";
task.ExtendedAttributes.Add(taskAttr);
MPPSaveOptions mppSaveOptions = new MPPSaveOptions();
mppSaveOptions.WriteViewData = true;
//Save the project as MPP project file
project.Save("result.mpp", mppSaveOptions);
I’ve downloaded a trial version of 9.2.1 of which I have a temporary license for evaluation. I’m using VS 2010 and MS Project 2010.
Thanks, Calvin
Hi Calvin,
Thank you for writing to Aspose Support team.
At present, Aspose.Tasks for .NET doesn’t support reading/writing these properties to MPP. Provision of these has been logged as TASKS-34492 in our issue tracking system for further consideration by our Product team. We’ll update you here once there is some more information available in this regard.
Hi Kashif,
I’m not quite sure I understand. The properties that are available and I’m able to set without compile error are not supported?
myTaskDurattr.CalculationType = CalculationType.Rollup;
myTaskDurattr.RollupType = RollupType.Sum;
taskAttr.DurationFormat = TimeUnitType.Hour;
Is there another way for me to add a custom duration column and have the duration displayed in hours?
Thanks, Calvin
Hi Calvin,
These properties are effective for XML format only, that is why these are available and compile without an error. However, due to some bug this feature is not working with XML as well. I have logged a bug for maintaining these properties in XML output file under Id: TASKS-34516.
Since this feature was not available earlier for MPP file, that is why other enhancement ticket is logged under Id: TASKS-34492.
You will be automatically notified once any update is available about any one of these tickets
Hi Calvin,
The issue TASKS-34492 is yet to be investigated as the MPP specifications for these are to be further analyzed for supporting. There is no ETA available for this issue at the moment and we’ll update you here once there is some information available in this regard.
Hi Kashif,
Has any investigation been completed on this new requirement? Any chance there is a possible ETA for this issue now?
Thanks, Calvin
Hi Calvin,
I am glad to share that TASKS-34492 is resolved and will be part of our incoming release. It is expected in few days and request is sent to product team to provide updated ETA. I will write back here as soon as some feedback is received in this regard.
The issues you have found earlier (filed as TASKS-34516) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.