We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Converting MPP files to PDF

The documentation pertaining to this on the web page http://www.aspose.com/docs/display/tasksnet/Saving+a+Project+as+PDF#SavingaProjectasPDF-CustomizingDateFormat shows that you should be able to set the date format when outputting a project to PDF however the property Project.DateFormat does not exist in the API. See below extract from the page:

Customizing Date Formats

Aspose.Tasks allows developers to customize the date format using the DateFormat enumerator when rendering project data.

C#

Project project = new Project();

project.StartDate = new DateTime(2014, 9, 22);

// By default project.DateFormat == DateFormat.Date_ddd_mm_dd_yy (Mon 09/22/14)

// customize DateFormat (September 22, 2014)

project.DateFormat = DateFormat.Date_mmmm_dd_yyyy;

project.Save("saved.pdf", SaveFileFormat.PDF);

There is a DateFormat available on the Task class but this appears only to be used other Task classes such as Table. And it only supports different versions of the American mm/dd/yyyy date format, i.e. mmm mm/dd/yyyy being Tue 9/30/2016.

Can someone pleas assist?

Hi Colin,


Thank you for contacting Aspose support team.

You may please use following sample code to set the date time format and let us know the feedback.


Project project = new Project("Project1.mpp");

project.Set(Prj.StartDate,new DateTime(2014, 9, 22));

// By default project.DateFormat == DateFormat.Date_ddd_mm_dd_yy (Mon 09/22/14)

// customize DateFormat (September 22, 2014)

project.Set(Prj.DateFormat, DateFormat.DateMmmmDdYyyy);

project.Save("Project1.pdf", SaveFileFormat.PDF);

Hi Kashif

It doesn’t look like that code will work. I’m trying to set the date format to DD/MM/YYYY so I’m looking for a function like:

project.Set(Prj.DateFormat, DateFormat.DateDdMMYyyy);

To produce a date like: 19/07/2016

Incidentally, I’m actually using an existing MPP file that already has the correct date format set but Aspose is changing this during the conversion.

Hi Colin,

I have logged it as enhancement to provide this new format under Id: TASKS-34509. You will be automatically notified once this format is provided and new version is released.

Hi Kashif

Perhaps another useful enhancement might be to use the Date Format from the MPP file?

Any idea on how quickly we might see this feature added? We just purchased the Developer OEM license to develop a new product and this issue is a showstopper for us.

Hi Colin,

We have discussed it in detail and observed that date format is not stored in the MPP file but is saved by the application on the system somehow. It is not possible to extract date format from the MPP file. The only best option is to provide new date format as logged earlier.

I have discussed the inclusion of this enhancement in our current month release which is almost ready. Although it is late but developers are discussing the possibility. As this ticket is linked with this thread, so you will be automatically notified once any update is available in this regard.

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


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