Free Support Forum - aspose.com

Custom fields of date type that uses lookup table does not returns date value

I have mpp file that have two custom date type fields defined. TaskDat1 does not uses custom lookup table, so the user can type anyting, but TaskDat2 uses lookup table, so user have to select a value from that table. When importing this file using below code, value for TaskDat1 one are coming over just file, but the value for TaskDat2 not the date type. Its int value. However, when same file is saved as xml and imported, its works file. I have attached both files for you to reproduce this issue.

foreach (ASP.ExtendedAttribute extendedAttribute in aspTask.ExtendedAttribute)
{
PROM.AttributeDefinition attDef = new PROM.AttributeDefinition(extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName);
_prom.AttributeDefinitions.Add(attDef);

if (extendedAttribute.AttributeDefinition.Alias != null)
{
promTask.AttributeValues.Add(_prom.AttributeDefinitions[extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName], extendedAttribute.Value);
}
} foreach (ASP.ExtendedAttribute extendedAttribute in aspTask.ExtendedAttribute)
{
PROM.AttributeDefinition attDef = new PROM.AttributeDefinition(extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName);
_prom.AttributeDefinitions.Add(attDef);

if (extendedAttribute.AttributeDefinition.Alias != null)
{
promTask.AttributeValues.Add(_prom.AttributeDefinitions[extendedAttribute.AttributeDefinition.Alias ?? extendedAttribute.AttributeDefinition.FieldName], extendedAttribute.Value);
}
}

Hi Amit,


Thanks for writing to Aspose.Tasks support team.

I have analyzed the information provided by you and tried to reproduce it using the following code. In this code I displayed respective extended attributes along with the value and found that it was displaying TaskDat2 value as integer. Please verify if this is the issue which is indicated by you, otherwise please send us a console application which can be used to re-produce the issue. Once verified, we will log the issue in our issue tracking system.

//create a project reader instance
ProjectReader rdr = new ProjectReader();
//call read method of project reader object to get project object
Project prj = rdr.Read("EMAIL_428640\\Test Case 319.mpp");
//Declare ChildTasksCollector class object
ChildTasksCollector collector = new ChildTasksCollector();
//Use TaskUtils to get all children tasks in RootTask
TaskUtils.Apply(prj.RootTask, collector, 0);
//Parse all the recursive children
foreach (Task tsk in collector.Tasks)
{
Console.WriteLine("Task No. " + tsk.Uid);
ArrayList eas = tsk.ExtendedAttribute;
if (eas != null)
{
foreach (ExtendedAttribute extendedAttribute in eas)
{
if (extendedAttribute.AttributeDefinition.Alias == "TaskDat2" || extendedAttribute.AttributeDefinition.Alias == "TaskDat1")
{
Console.WriteLine(extendedAttribute.AttributeDefinition.Alias + "=" + extendedAttribute.Value);
}
}
}
Console.WriteLine("====================");
}

Following is the output :

Task No. 0
====================
Task No. 1
TaskDat2=598545088
TaskDat1=2010-08-01T08:00:00
====================
Task No. 2
TaskDat2=600642240
TaskDat1=2010-08-02T08:00:00
====================
Task No. 3
TaskDat2=598545088
TaskDat1=2010-08-03T08:00:00
====================
Task No. 4
TaskDat2=606409408
====================
Task No. 5
TaskDat2=608441024
TaskDat1=2010-08-05T08:00:00
====================
Task No. 6
TaskDat1=2010-08-01T08:00:00
====================

Your cooperation and understanding will be highly appreciated in this regard.

kashif,

Sorry for delayed response, and you are right, TaskDat2 should display date not the int value. Let me know in which build this will be fixed.

Thanks,
Amit

Hi Amit,


Thank you for the feedback.

I have forwarded these details, along with the sample MPP and XML files, to our development team for further investigation and will update you here once we have any information in this regard. The issue has been logged in our issue tracking system as: TASKS-33254.

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


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

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