Project.Read method throws NullPointerException

Hi

When I read the attached plan the ProjectReader method throws a NullPointerException.

ASPOSE.Project project = reader.Read(new FileStream(filePath, FileMode.Open));

Can you advise why this is happening please?

TIA

Craig

Hello Craig,


This happens because the file was created by MS Project 2010 and saved in MS Project 2003 format.

You can find the information in the file, just open it into notepad and search for ‘MSProject’:

"Microsoft.Project 14.0 MSProject.MPP9"

I have converted the file by MS Project 2003 and attached it to the message. Now it has to be processed properly.

We are working on MS Project 2010 (MPP14) format support.

Please also note that Aspose.Tasks does not support old MPP8 format any more (the format was used in some of your other files).

Hello Craig,

Files created by MS Project 2010(BETA) and saved in MS Project 2003/2007 formats have some differences from the original MS Project 2003/2007 files. We are planning to add the files reading support after MSP2010 mpp format processing is being added.

The issue ‘Reading support mpp files created by MSP 2010 and saved in MSP 2003/2007 formats.’ with id = 13865 has been created and linked to this forum thread.

Also we think that some method to define mpp file format and version before/without file reading could be helpful. The issue ‘Defining mpp file format and MSP version before/without file reading.’ has been created in our corporate issue tracking system. The issue id is 13866.

Sorry for long delay but some deep file structure analysis was required.

Hi Craig,

Some updates.

The issue 13865 is not resolved yet, but we have added defining file format without full file reading support (issue id=13866). Now you can define MPP or MSP XML file format as well as has Aspose.Tasks to read the project data.

You can see a sample of using below and a screen shot in attachment.

OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "Project files (*.mpp)|*.mpp";
if (dlg.ShowDialog() == DialogResult.OK)
{
    ProjectReader reader = new ProjectReader();
    ProjectFileInfo info = reader.ReadProjectFileInfo(dlg.FileName);
    StringBuilder sb = new StringBuilder();
    sb.AppendLine("File format: " + info.ProjectFileFormat);
    sb.AppendLine("File published by: " + info.ProjectApplicationInfo);
    sb.AppendLine("Can read: " + (info.CanRead? "Yes" : "No"));
    MessageBox.Show(sb.ToString());
}

You can try to read project data and in case if CanRead method returns False, but in some cases you will get an exception or empty project data.

The ProjectReader’s ReadProjectFileInfo method reads only file structure and file formats, so it can not give you 100% guarantee that the project data will be processed completely (e.g. some file data can be damaged), but it can give you information about why the file can not be processed.

We are planning to add a support for files created in MS Project 2010 and saved in old MPP9/MPP12 formats in March release.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.