Free Support Forum - aspose.com

TimephasedData


#1

Hello could you help me?

I need to distribute the work of a task.

I’ve tried this:

using System;
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");

            Project project = new Project("Template2016new.mpp") { CalculationMode = CalculationMode.Manual };
            project.Set(Prj.StartDate, new DateTime(2018, 1, 1));


            Task tsk1 = project.RootTask.Children.Add("Task - 01");
            Task tsk2 = tsk1.Children.Add("Task - 01.01");

            Task tsk3 = tsk2.Children.Add("Task - 01.01.001");

            tsk3.TimephasedData.Clear();
            TimephasedData item = new TimephasedData
            {
                Start = new DateTime(2018, 1, 1, 8, 0, 0),
                Finish = new DateTime(2018, 1, 1, 8, 0, 0).AddDays(1),
                TimephasedDataType = TimephasedDataType.AssignmentRemainingWork,
                Value = TimeSpanToTDString(TimeSpan.FromHours(8))
            };
            tsk3.TimephasedData.Add(item);

            TimephasedData item2 = new TimephasedData
            {
                Start = new DateTime(2018, 1, 2, 8, 0, 0),
                Finish = new DateTime(2018, 1, 2, 8, 0, 0).AddDays(1),
                TimephasedDataType = TimephasedDataType.AssignmentRemainingWork,
                Value = TimeSpanToTDString(TimeSpan.FromHours(8))
            };

            tsk3.TimephasedData.Add(item2);

            project.Recalculate();
            project.RecalculateResourceFields();
            project.RecalculateResourceStartFinish();

            project.Save(@"output.xml", Aspose.Tasks.Saving.SaveFileFormat.XML);
            project.Save(@"output.mpp", Aspose.Tasks.Saving.SaveFileFormat.MPP);
        }

        static private string TimeSpanToTDString(TimeSpan timeSpan)
        {
            return string.Format("PT{0}D{1}H{2}M{3}S", timeSpan.Days, timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
        }
    }

}

But the output file did not generate the data (TimePhasedData).

output.PNG (35.4 KB)
Template2016new.zip (24.1 KB)

What am I doing wrong?


#2

@FabioMartins,

I have tested the sample code shared by you and have been able to observe the issue. An issue with ID TASKSNET-3101 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?

I really need urgency in this case.


#4

@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.