Setting values in a chart pie by code
Posted: Tue Jan 12, 2016 6:08 pm
Hi,
I want to set the values to a chart pie by code with a datasource.
I see with the debugger that the value is taken, but at the end I have an error message with:
A first chance exception of type 'System.InvalidCastException' occurred in Stimulsoft.Report.dll
And the stack trace:
à Stimulsoft.Report.Chart.StiChartHelper.GetValuesFromValueDataColumn(StiChart masterChart, StiSeries series)
à Stimulsoft.Report.Chart.StiChartHelper.GetValues(StiChart masterChart, StiSeries series)
à Stimulsoft.Report.Chart.StiChartHelper.CreateChart(StiChart masterChart, StiChart chartComp)
à Stimulsoft.Report.Engine.StiChartV2Builder.RenderChart(StiChart masterChart)
à Stimulsoft.Report.Engine.StiChartV2Builder.InternalRender(StiComponent masterComp)
à Stimulsoft.Report.Components.StiComponent.InternalRender()
à Stimulsoft.Report.Engine.StiComponentV2Builder.Render(StiComponent masterComp)
à Stimulsoft.Report.Components.StiComponent.Render()
à Stimulsoft.Report.Engine.StiContainerV2Builder.InternalRender(StiComponent masterComp)
à Stimulsoft.Report.Engine.StiBandV2Builder.InternalRender(StiComponent masterComp)
à Stimulsoft.Report.Components.StiComponent.InternalRender()
à Stimulsoft.Report.Engine.StiEngine.InternalRenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents, Boolean& isChildsEnabled)
à Stimulsoft.Report.Engine.StiEngine.RenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents)
à Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderBand(StiDataBand masterDataBand, StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents)
à Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderMaster(StiDataBand masterDataBand)
à Stimulsoft.Report.Components.StiDataBand.RenderMaster()
à Stimulsoft.Report.Engine.StiPageHelper.RenderPage(StiPage page)
à Stimulsoft.Report.Engine.StiRenderProviderV2.RenderReport(StiReport report, StiReport masterReport, StiRenderState state)
à Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state)
à Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState)
I have tried to put IEnumerable<double>, double[] and double?[] but this is always the same
(double?[] does a special thing because the ? is converted into a special char into the report code and the report become useless).
Have you a sample to show me or the good type to use? Is it a StiSeries/StiPieSeries/...?
Thanks.
I want to set the values to a chart pie by code with a datasource.
I see with the debugger that the value is taken, but at the end I have an error message with:
A first chance exception of type 'System.InvalidCastException' occurred in Stimulsoft.Report.dll
And the stack trace:
à Stimulsoft.Report.Chart.StiChartHelper.GetValuesFromValueDataColumn(StiChart masterChart, StiSeries series)
à Stimulsoft.Report.Chart.StiChartHelper.GetValues(StiChart masterChart, StiSeries series)
à Stimulsoft.Report.Chart.StiChartHelper.CreateChart(StiChart masterChart, StiChart chartComp)
à Stimulsoft.Report.Engine.StiChartV2Builder.RenderChart(StiChart masterChart)
à Stimulsoft.Report.Engine.StiChartV2Builder.InternalRender(StiComponent masterComp)
à Stimulsoft.Report.Components.StiComponent.InternalRender()
à Stimulsoft.Report.Engine.StiComponentV2Builder.Render(StiComponent masterComp)
à Stimulsoft.Report.Components.StiComponent.Render()
à Stimulsoft.Report.Engine.StiContainerV2Builder.InternalRender(StiComponent masterComp)
à Stimulsoft.Report.Engine.StiBandV2Builder.InternalRender(StiComponent masterComp)
à Stimulsoft.Report.Components.StiComponent.InternalRender()
à Stimulsoft.Report.Engine.StiEngine.InternalRenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents, Boolean& isChildsEnabled)
à Stimulsoft.Report.Engine.StiEngine.RenderBand(StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents)
à Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderBand(StiDataBand masterDataBand, StiBand band, Boolean ignorePageBreaks, Boolean allowRenderingEvents)
à Stimulsoft.Report.Engine.StiDataBandV2Builder.RenderMaster(StiDataBand masterDataBand)
à Stimulsoft.Report.Components.StiDataBand.RenderMaster()
à Stimulsoft.Report.Engine.StiPageHelper.RenderPage(StiPage page)
à Stimulsoft.Report.Engine.StiRenderProviderV2.RenderReport(StiReport report, StiReport masterReport, StiRenderState state)
à Stimulsoft.Report.Engine.StiRenderProviderV2.Render(StiReport report, StiRenderState state)
à Stimulsoft.Report.Engine.StiReportV2Builder.RenderSingleReport(StiReport masterReport, StiRenderState renderState)
I have tried to put IEnumerable<double>, double[] and double?[] but this is always the same
(double?[] does a special thing because the ? is converted into a special char into the report code and the report become useless).
Have you a sample to show me or the good type to use? Is it a StiSeries/StiPieSeries/...?
Thanks.