Reading outline codes

Hi,

in .NET im using Aspose.Tasks 25.2.0 to read a primavera project, this project file has 25 outline codes, but it seems that Aspose.Tasks reads first 10 and forgets about the others, why is that?

@Herrington

It seems that you are experiencing an issue where Aspose.Tasks is only reading the first 10 outline codes from your Primavera project file, despite there being 25 outline codes present. This could be due to a limitation in the version you are using or how the outline codes are being accessed.

To retrieve all outline codes, you can use the OutlineCodeDefinition class, which provides access to the details of each outline code. Here’s a sample code snippet that demonstrates how to read all outline codes from a project:

using Aspose.Tasks;
using System;

namespace Aspose.Tasks.Examples.CSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Load the project
            var project = new Project("path_to_your_project_file.mpp");

            // Iterate through all outline codes
            foreach (var outlineCode in project.OutlineCodes)
            {
                Console.WriteLine("Alias: " + outlineCode.Alias);
                Console.WriteLine("Field Id: " + outlineCode.FieldId);
                Console.WriteLine("Field Name: " + outlineCode.FieldName);
                Console.WriteLine("Guid: " + outlineCode.Guid);
                Console.WriteLine("Values:");
                
                foreach (var value in outlineCode.Values)
                {
                    Console.WriteLine("  Value Id: " + value.ValueId);
                    Console.WriteLine("  Description: " + value.Description);
                }
            }
        }
    }
}

Make sure to replace "path_to_your_project_file.mpp" with the actual path to your Primavera project file. This code will iterate through all outline codes and print their details, including any associated values.

If you continue to face issues with reading all outline codes, consider checking for any updates or documentation related to the version of Aspose.Tasks you are using, as there may be improvements or bug fixes in newer versions that address this limitation.

For more detailed information on working with outline codes, you can refer to the official documentation on this topic.

If you have any further questions or need additional assistance, feel free to ask!

Sources:
[1]: Working with Outline Codes in a Project - Aspose Documentation

@Herrington ,
The limitation is induced by that fact that Aspose.Tasks is based on MS Project’s model. MS Project have support of 10 Outline Codes. Thus only first 10 Activity Codes are read from XML or XER file.

We’ll address this issue in in one of the next versions of Aspose.Tasks for .NET.

@Herrington
I’ve linked the following existing ticket in our internal issue tracking system. The fix will be delivered according to the terms mentioned in Free Support Policies.

Issue ID(s): TASKSNET-11415

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as TASKSNET-11415) have been fixed in this update.
Download link: Aspose.Tasks for .NET