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
@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.
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
@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)
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.
@Opus_Team,
Can you please share your desired output or comparison screenshot for further investigation.
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
@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.
1 Like
Hi Adnan,
Any updates on this issue ?
@Opus_Team,
I have verified from our issue tracking system and like to share that issue is tentatively going to get resolved in Aspose.Tasks for .NET 20.2 and we will share feedback with you once it will be fixed.
The issues you have found earlier (filed as TASKSNET-3601) have been fixed in this update.
Hi @mudassir.fayyaz,
@aspose.notifier,
We still occur the issue after updating the version. Until 20.6.0 version except the 20.5.0 version that crash.The custom styling is applied on only the default tasks and not the summary tasks and millestones.
We hace notice that from the 20.7.0 vesion, the custom styling is not applied on the 3 types of tasks : default task, summary tasks and millestones.
Thank you for your help !
EPrep_Team ( former OPUS_Team)
@EPrepTeam
Can you please possibly verify using latest 20.11 on your end and share your views. If there is still an issue then please share the working sample code, source file and generated output with issue. We will investigate it again on our end based on shared information.
Hi @mudassir.fayyaz,
We have verified with the 20.10.0 version and there is no issue anymore.
Thank you for your support !
EPrep_Team ( former OPUS_Team)
@EPrepTeam
It’s good to know that issue is resolved on your end.