Hi
I want to create a stacked bar chart using RAS .Net SDK programmatically. I am able to create a a normal bar chart but not able to specify its sub type (side by side/stacked/percent) like in crystal designer.
I explored all the help guides and had a good look over Report Application Server .NET SDK Developer Guide but can't find any solution.
The code mentioned in this help file runs fine but it also outputs a normal bar chart. I figured CrystalDecisions.ReportAppServer.ReportDefModel.CrBarChartStyleSubtypeEnum for this but not able to figure out how to use this. I can't see any property using this enum.
I explored a couple of discussions and read "API control over charts is very, very limited and .Net sdk provides minimal ability for accessing chart objects." as mentioned in How to Manage property of Chart Expert and Chart Options for ChartObject using .NET RAS SDK.too.
Kindly help me up with this and suggest if it is supported now or not? We are going to have a huge impact if it is not supported.
Sample code for reference as copied from help file:
Dim myChartDefinition As ReportDefModel.ChartDefinition = New ReportDefModel.ChartDefinition()
myChartDefinition.ChartType = ReportDefModel.CrChartTypeEnum.crChartTypeGroup
Dim myDataDef As DataDefModel.DataDefinition = crRepDoc.ReportClientDocument.DataDefController.DataDefinition
Dim conditionFields As DataDefModel.Fields = New DataDefModel.Fields
Dim field As DataDefModel.ISCRField = myDataDef.DataDefinition.Groups.Item(1).ConditionField
conditionFields.Add(field)
myChartDefinition.ConditionFields = conditionFields
Dim dataFields As DataDefModel.Fields = New DataDefModel.Fields
Dim summaryFields As DataDefModel.Fields = crRepDoc.ReportClientDocument.DataDefController.DataDefinition.SummaryFields
Dim summaryField As DataDefModel.ISCRField
For Each summaryField In summaryFields
dataFields.Add(summaryField)
Next
myChartDefinition.DataFields = dataFields
Dim myChartObject As ReportDefModel.ChartObject = New ReportDefModel.ChartObject
myChartObject.ChartDefinition = myChartDefinition
myChartObject.ChartStyle.Type = ReportDefModel.CrChartStyleTypeEnum.crChartStyleTypePie
myChartObject.ChartReportArea = ReportDefModel.CrAreaSectionKindEnum.crAreaSectionKindReportHeader
myChartObject.ChartStyle.TextOptions.Title = chartTitle
myChartObject.Height = 5000
myChartObject.Width = 5000
myChartObject.Top = 1000
Dim area As ReportDefModel.ISCRArea = crRepDoc.ReportClientDocument.ReportDefController.ReportDefinition.ReportHeaderArea
Dim sectionToAddTo As ReportDefModel.Section = CType(area.Sections(0), ReportDefModel.Section)
crRepDoc.ReportClientDocument.ReportDefController.ReportObjectController.Add(myChartObject, sectionToAddTo, 1)