Hi Team,
I have a license for Aspose Total. I have to Plot some Gantt Chart in pptx(Aspose Slides). Data is coming from the data base in the for of Data table or collection .Every where I have got the sample for creating Gantt chart from mpp file and Creating Mpp file as XML.
Plesae provide some sample or steps where I can create Gantt Chart from the dynamic data from database.
Thanks
Sushanta
Hi Sushanta,
Hi Mudassir,
Thanks for ur reply . Could you please attach a sample code for this request,which will be helpful to find out some soln for my requirements.
And one more query, Is there any options in Aspose where we can create a MPP file dynamically and can plot the gantt chart using that MPP file.
Thanks
Sushanta
Hi Sushanta,
Hi Mudassir,
Thanks for the reply. I can not add MS Project 2010 format so I have to do some custom coding to hide first series from ChartTypeEx.StackedBar. But as my date range is on monthly basis I need to make the value axis interval = 1 and needs to cahnge the axis label as jun-13,jul-13 etc. If u could put any light on the same will be helpful.
FYI..
In my .net side I am able t0 achive the same as follows :
Dim lineAxis As New LinearAxis
lineAxis.Orientation = AxisOrientation.X
lineAxis.Interval = 1
lineAxis.Foreground = New SolidColorBrush(Colors.White)
lineAxis.Minimum = Month(minDat)
lineAxis.Maximum = Month(minDat) + 13
chart1.Axes.Add(lineAxis)
Dim dateAxis As New DateTimeAxis
dateAxis.Orientation = AxisOrientation.X
dateAxis.IntervalType = DateTimeIntervalType.Months
dateAxis.VerticalAlignment = Windows.VerticalAlignment.Top
dateAxis.VerticalContentAlignment = Windows.VerticalAlignment.Top
dateAxis.Interval = 1
dateAxis.ShowGridLines = True
Dim dtExactDate, dtExactDate1 As Integer
Dim dtExact As Date
dtExact = maxDat.AddMonths(1)
dtExactDate = -(minDat.Day)
dtExactDate1 = -(dtExact.Day)
dateAxis.Minimum = minDat.AddDays(dtExactDate + 1)
dateAxis.Maximum = dtExact.AddDays(dtExactDate1 + 1)
Dim axisLabelStyle = New Style(GetType(DateTimeAxisLabel))
axisLabelStyle.Setters.Add(New Setter(DateTimeAxisLabel.StringFormatProperty, "{0:MMM-yy}"))
chart1.Axes.Add(dateAxis)
Hope above part will help u understand my requirements.
As I am new to aspose,Any sample codes from you will be helpful.
Thanks
Sushanta
Hi Sushanta,
PresentationEx pres = new PresentationEx();SlideEx sld = pres.Slides[0];Aspose.Slides.Pptx.ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.StackedBar, 10, 60, 700, 300);chart.ValueAxis.SourceLinked = false;chart.ValueAxis.BaseUnitScale = TimeUnitType.Months;chart.ValueAxis.NumberFormat = “[$-409]mmm-yy;@”;chart.ValueAxis.IsAutomaticMajorUnit = false;chart.ValueAxis.IsAutomaticMinorUnit = false;chart.ValueAxis.IsAutomaticMaxValue = false;chart.ValueAxis.IsAutomaticMinValue = false;//Starting day numberchart.ValueAxis.MinValue = 1;//Ending day numberchart.ValueAxis.MaxValue = 365;//Setting month wise intervalchart.ValueAxis.MajorUnit = 30;//setting minor unit to 10 dayschart.ValueAxis.MinorUnit = 10;chart.ValueAxis.MinorUnitScale = TimeUnitType.Days;chart.ValueAxis.MajorUnitScale = TimeUnitType.Months;chart.HasLegend = false;pres.Write(“D:\Aspose Data\Bar.pptx”);
Hi Mudassir,
Thanks a lot for your respone. With your help, I am near to my goal . Only One Issue ,Hope you will be able to help me.
Hi Sushanta,
PresentationEx pres = new PresentationEx();SlideEx sld = pres.Slides[0];Aspose.Slides.Pptx.ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.StackedBar, 10, 60, 700, 300);chart.ValueAxis.SourceLinked = false;chart.ValueAxis.BaseUnitScale = TimeUnitType.Months;////[$-409]mmm-yy;@chart.ValueAxis.NumberFormat = “[$-409]mmm-dd;@”;chart.ValueAxis.IsAutomaticMajorUnit = false;chart.ValueAxis.IsAutomaticMinorUnit = false;chart.ValueAxis.IsAutomaticMaxValue = false;chart.ValueAxis.IsAutomaticMinValue = false;//Starting day numberchart.ValueAxis.MinValue = 13;//Ending day numberchart.ValueAxis.MaxValue = 365;//Setting month wise intervalchart.ValueAxis.MajorUnit = 30.5f;//setting minor unit to 10 dayschart.ValueAxis.MinorUnit = 10;chart.ValueAxis.MinorUnitScale = TimeUnitType.Days;chart.ValueAxis.MajorUnitScale = TimeUnitType.Months;chart.HasLegend = false;pres.Write(“D:\Aspose Data\Bar.pptx”);
Hi Mudassir,
Thanks a lot for your helping hand to achive the requirement related to Gantt chart.
I am facing another issue related to export to excel. I am using ImportDataTable like.... sheet.Cells.ImportDataTable(dataTable, true, "A1");
1. Date fields in Datatable are coming with whole things i.e. including time part.I need just MM/dd/YYYY value on My excel.
2. For null date type value its comming as default date value like 1999.......need to get blank in place of the default db values.
3. Some colums in my result set are description fields containg more than 500 characters. I want to implement Wrap text property with fixed width of column.
Please put your suggetion or if any samples are there for the same. If I will loop through all my rows in my result set it will create performance issue as I am exporting large # of records.
Thank You.
Sushanta
Hi Sushanta,
Thanks Mudassir.will do the same…