Gantt bar styling does not apply on summary tasks and milestones


#1

Hello,

Gantt bar styling applies on default tasks, but not on summaries nor milestones.

Code sample for a milestone :

var defaultView = _project.DefaultView as GanttChartView;
var chartView0 = _project.Views.ToList()[0] as GanttChartView;
var chartView1 = _project.Views.ToList()[1] as GanttChartView;

Aspose.Tasks.Task currentTask = _project.RootTask.Children.Add(task.Name);
currentTask.Set(Tsk.Start, new DateTime(2019, 10, 21, 08, 00, 00));
currentTask.Set(Tsk.Duration, _project.GetDuration(0, TimeUnitType.Day));

Color color = Color.Yellow;

GanttBarStyle style = new GanttBarStyle();
style.ShowFor = currentTask.Get(Tsk.Uid).ToString();

style.MiddleShape = GanttBarMiddleShape.RectangleBar;
style.MiddleFillPattern = GanttBarFillPattern.SolidFill;
style.MiddleShapeColor = color;

style.StartShapeType = GanttBarType.Solid;
style.StartShape = GanttBarEndShape.NoBarEndShape;
style.StartShapeColor = color;

style.EndShapeType = GanttBarType.Solid;
style.EndShape = GanttBarEndShape.NoBarEndShape;
style.EndShapeColor = color;

defaultView.CustomBarStyles.Add(style);
chartView0.CustomBarStyles.Add(style);
chartView1.CustomBarStyles.Add(style);

The same applies for summaries.

Thank you for your help


#2

@Opus_Team,

Can you please share complete working sample project along with generated result and sample code so that we may further investigate to help you out.


#3

Hello,

This code sample is basically all you need to reproduce the issue.
Please find attached the generated file :
MPP_Export_Output.zip (23.3 KB)

Best regards


#4

@Opus_Team,

I have worked with source code shared by you and unable to observe issue. Can you please check attachment. Also please share source file and generated result comparison screenshot with us for further investigation.Wrr.zip (23.9 KB)


#5

Thank you for your help Adnan,
It appears that in the .mpp file you provided the milestone is not yellow, as it should be with the code sample I provided, this is the issue we are facing.


#6

@Opus_Team,

Can you please share your desired output or comparison screenshot for further investigation.


#7

Please find attached a screenshot of the actual behavior and an image of the expected output :
actual-expected.zip (4.8 KB)

Thank you for your help


#8

@Opus_Team,

I have created an issue with ID TASKSNET-3601 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be addressed.