Project.DaysPerMonth

I am trying to retrieve the Project.DaysPerMonth. This shows up in documentation but using it will not let me compile and it does not show up in intellisense.

Any idea?

Dan

Dear Dan,



This property exists in Aspose.Project.XML.Project class only.

It’s a class from XML scheme and used only for direct access project

files in XML format.



Aspose.Project.Project class doesn’t have such property.

I recently purchased Aspose.Project. It seems my evaluation was not thorough enough, since I have hit a snag that I currently do not see a workaround for. Perhaps you can help me.

One of the properties we need to grab from one of the MSProject file formats is the projects "Days Per Month" The DefaultSettings properties contains:

DefaultHoursInDay Returns or sets the default number of hours in a day. Read/write Single.
DefaultHoursInWeek Returns or sets the default number of hours in a week. Read/write Single.

I really need to know the DefaultDaysPerMonth. Without it, we are not capable of transforming durations and work properly. In the MSProject files, this property can be found in Tools/Options/Calendar, right underneath the already implemented fields defined above.

Would this be possible to add as a property to the DefaultSettings? If so, how long do you think it would take? I apologize for my sense of urgency but unfortunately, I am stuck without it.

Thanks,

Dan H.

Dear Dan,



You can read DefaultDaysPerMonth from XML format.

For MPP I will check possibility to add such property.

Is there an example of using the namespace Aspose.Project.XML? Perhaps an example, similar to the featured project "ProjectQuery", which reads an XML file and queries it using the Aspose.Project.XML namespace?

Thanks,

Dan

Dear Dan,



Aspose.Project.XML namespace is XML scheme only. To read project you should write:



TextReader reader = new StreamReader(inputStream);

XmlSerializer serializer = new XmlSerializer(typeof(Aspose.Project.XML.Project));

Aspose.Project.XML.Project project = (Aspose.Project.XML.Project)serializer.Deserialize(reader);



And after that you can read project properties:



int days = project.DaysPerMonth;

int hours = project.MinutesPerDay;

DateTime start = project.StartDate;

string author = project.Author;



project.Resources property contains list of all resources.

project.Tasks - all tasks and etc.

I forgot to write one thing. If value you read is not string (for example DaysPerMonth) then

at first you should check if this property exists in xml file:



if (project.__DaysPerMonthSpecified)

days = project.DaysPerMonth;

else

days = // some default value

"For MPP I will check possibility to add such property"

I wanted to check on the status of adding DaysPerMonth to the mpp reader. Unfortunately for us, the lack of this feature is a show stopper and we have put using Aspose.Project on hold.

Would it be possible to add DaysPerMonth and if so, would it be possible to provide an estimate of completion time?

Thanks

Dan

P.S. I would like to explain the exact reason for the need of DaysPerMonth. Perhaps there is an alternative implementation that I am not seeing or perhaps I am overlooking something obvious.

Most of the .mpp/xml files we are converting have task durations formatted in months. It is highly important that we present the data formatted the same way. As an example, I created a xml file with just a single task. (attached)

Days Per Month of 22 days. Task1 with 1 month duration. The Duration.Value is 176. The Duration.ValueType is Hours. The DurationFormat is Month. If I want to convert the task duration back to 1 month, the math is:

176 hours / 8 hours per day = 22 days; 22 days/ 22 days per months = 1 month.

Without knowing Days Per Month, I do not know how to format the duration value of 176 days to months. Any workarounds you can see?

Thanks,

Dan