Hello! I have two mistakes, help me figure it out pls
OS on which I tried:
- local - MacOs Monterey 12.2.1
- server - Ubuntu 20.04 lts
-
Error when saving mpp file
if i try to run this code:
var project2 = new Project();
project2.Set(Prj.Name, “Test”);
View view = new GanttChartView();view.ShowInMenu = true; view.HighlightFilter = true; view.Filter = null; view.Group = null; view.Table = null; view.PageInfo.PageViewSettings.FirstColumnsCount = 4; view.PageInfo.PageViewSettings.PrintFirstColumnsCountOnAllPages = true; project2.Views.Add(view); project2.Save( "test.mpp", new MPPSaveOptions { WriteViewData = true });
an error occurs:
Aspose.Tasks.TasksWritingException: Project writing exception.
—> System.NullReferenceException: Object reference not set to an instance of an object.
at #=zb7ZUF0iESYl0Kd3IW$Wb0ZnMFtGpczJ5Dw==.#=zk03ZuFk=(View #=zxvF9atw=)
at #=zb7ZUF0iESYl0Kd3IW$Wb0ZnMFtGpczJ5Dw==.#=zqMuf1Pk=(View #=zxvF9atw=)
at #=zb7ZUF0iESYl0Kd3IW$Wb0ZnMFtGpczJ5Dw==.#=zJ109aAI=(View #=zxvF9atw=)
at #=zb7ZUF0iESYl0Kd3IW$Wb0ZnMFtGpczJ5Dw==.#=zJ109aAI=(Boolean #=zNuz5AToeRaf$)
- Incorrect data after saving mpp file
if i try to run this code is successful
var project = new Project("template.mpp");
//logic to add extented attributes in project
SetAllExtendedAttribute(ref project, listGuidProject);
fullInfo.TasksProject = fullInfo.TasksProject.OrderBy(a => a.WBS).ToList();
//logic to add task in project
SetAllTask(ref project, fullInfo.TasksProject);
var memoryStream = new MemoryStream();
project.Save(memoryStream, new MPPSaveOptions() { WriteViewData = true });
memoryStream.Position = 0;
return new InfoExportMppDto
{
File = memoryStream
};
but output date in file incorrect
image.jpg (62.1 KB)
“Стадия ЖЦ” - its extented attributes Text22
“Вид работ” - its extended attibutes Text26
Default field write correct, but extended attributes no. They should contain words, but symbols or single letters are displayed that are not related to the data. And if you import this file and upload it to stream and then to the project , then the data inside is correct