Free Support Forum - aspose.com

Storing additional information

Hi,

I am using Aspose.Project to create a microsoft project file from a database, and then read the file back in to update. I would like to store several pieces of custom information on the project for use when updating the database. For task information, I can use the TextN fields supplied by your api, but I don’t see any way to store extra data that belongs to the file or project. Do you have any suggestions?

Thanks,
Matt

Hello Matt,

Thanks for your question.

For storing custom project information you can use Project.Comments property.

Also MPX format has definition for internal comments (lines with code 0). Aspose.Project doesn’t support it but it’s possible to add mpx comments to the next release (or hot fix).

Hi,

Lines with code 0 sound like a good idea, but if the file is opened in Microsoft and saved (as an mpp), will those comments still be available when the new file is read back in? If they are lost upon saving as an mpp then they are of little use to us.

Thank you for the suggestions,

Matt

Hello Matt,

MS Project will skip all comment on mpp saving so you will lose it.
I’d suggest to use Comments property.

Hi,

For data that I do not want users to see or edit, I have found that the best place to store it is in the TextN and NumberN properties of an extra Task with ID = 0. This task is not visible in the grid, and its properties are preserved upon saving as an mpp.

There is other data which I do want to put in Project.Comments, but it seems that the Comments cannot be read from an mpp file by Aspose. Simply saving an mpx as an mpp causes the Comments to be null when the file is read in. Project.Subject has the same problem, and other similar properties may too.

Thanks,
Matt

Hello Matt,

Thanks for remainding about these properties.

Reading Author, Comments, Company, Keywords, Manager, Subject and Title properties from mpp files was added to the new hot fix.
Please check my post about Aspose.Project 1.1.3.0.

Hi,

When reading and writing Task.Notes, Aspose.Project appears to escape \n characters for the MPX format. I am wondering if Project.Comments should work the same way.

There may also be other fields that I haven’t run into yet which should escape \n. Do you have a list of the fields supported by Aspose that are supposed to accept multi-line values?

I have also noticed that you appear to be using a task with ID 0 to store the Project.Title when writing an MPX file. I was using the ID 0 task to store data of my own. Is there anything else that you are going to put in the ID 0 task? Can I use the other fields there to store my data?

Thanks,
Matt

Hello Matt,

Thanks for your consideration.

1. Multi-line text values are supported by .Notes fields only but I can add it for Comments too.
2. I’m not going to put anything to task with ID 0. MS Project uses name of this task as Title by default. I just found it and linked Project.Title property to Task0.Name for more convenience.

Hi,

Yes, I think Project.Comments should escape \n since it appears as a multi-line input in the File Properties dialog. In fact, if I take an mpp file with several lines in the comments and just use Aspose to convert it to an mpx file, the result cannot be read by MS because the newlines have not been escaped.

Thanks,
Matt

Hello Matt,

Multi-line Comments were added to the new hot fix.
Please check Aspose.Project 1.1.4.0.

Hi,

The writing of multi-line comments is good. Thanks.

I’m not sure what I’m supposed to get when reading in a file with multi-line comments. If the file is an mpp, then the comments have \r\n fow newlines, while if it’s an mpx file, it still has x7F for newlines. When I read the notes for a task in mpp or mpx format, newlines are represented with a single \n. Any of these are OK with me, but for consistency I expect that you will want to use \n in all cases.

Thanks,
Matt

Dear Matt,

Sorry for delay. Newlines characters were fixed.
It will be always \n for both MPP and MPX formats.
Please check Aspose.Project 1.1.5.