Free Support Forum - aspose.com

How to get assignment dates?


#1

Hello,
I am trying to import the start and end dates, but the imported values are different from the mpp file.

using System.IO;
using Aspose.Tasks;
using Aspose.Tasks.Saving;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            License license = new License();
            license.SetLicense("Aspose.Tasks.lic");

            FileStream arquivoMPP = new FileStream("ImportTest.mpp", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

            Project project = new Project(arquivoMPP);

            foreach (var resourceAssignment in project.ResourceAssignments)
            {

                Console.WriteLine("Atribuição: " + resourceAssignment.ToString() +
                              "  assigment.Get(Asn.Units): " + (resourceAssignment.Get(Asn.Units)).ToString() +
                              "  assigment.Get(Asn.Work): " + (resourceAssignment.Get(Asn.Work)).ToString() +
                              "  assigment.Get(Asn.Start): " + (resourceAssignment.Get(Asn.Start)).ToString() +
                              "  assigment.Get(Asn.Finish): " + (resourceAssignment.Get(Asn.Finish)).ToString());
            }
            Console.ReadKey();
        }
    }
}

Attached the mpp file:
ImportTest.zip (32.3 KB)

ImportTest.png (92.3 KB)

what am I doing wrong?

Can you help me? @mudassir.fayyaz @kashif.iqbal @alexanderefremov1


#2

@FabioMartins,

I have tested the sample code shared by you and have been able to observe the issue. An issue with ID TASKSNET-3092 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


#3

Hi,

any news?


#4

@FabioMartins,

I have verified the issue status from our issue tracking system and like to share that it has just recently been created in our issue tracking system and is pending for investigation in our issue tracking system. I request for your patience till the time the issue gets resolved.


#5

Hi, any news?

I really need urgency in this case!


#6

@FabioMartins,

I regret to inform that issue is pending for detail investigation. I also like to inform as per our company policy, the first priority for investigation is given to the Paid Support i.e. Enterprise and Priority Support on first come first serve basis. After that the issues from normal support forum are scheduled for investigation on first come first serve basis. I request for your patience. We will share good news with you soon regarding ETA.


#7

@FabioMartins Hello,

Did you check it on the latest Aspose.Tasks for .NET 19.3?

We found that Aspose.Tasks and MS Project 2016 shows the same values. Please checkout the code below an the images attached.
MSP 2016.png (89.5 KB)
AT 19.3.png (80.1 KB)

var p = new Project("ImportTest.mpp");
foreach (var task in p.SelectAllChildTasks())
{
	foreach (var assignment in task.Assignments)
	{
		Console.Write(task.Get(Tsk.Name).PadRight(35)); 
		Console.Write(assignment.Get(Asn.Resource).Get(Rsc.Name).PadRight(30)); 
		Console.WriteLine(" " + assignment.Get(Asn.Work).ToString().PadRight(10) + " " + assignment.Get(Asn.Start).ToString("g").PadRight(20) + " " + assignment.Get(Asn.Finish).ToString("g").PadRight(20));
	}
}

#8

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