Page 1 of 1

Dynamically Choose CHart Column

Posted: Mon Jun 05, 2017 12:05 am
by cbrydon
Hi,

I'm trying to create a report where a user can pick from a list of columns to use as the value data column in a
clustered column chart. I have RequestParameters set to true on the chart. To keep things simple and to make
sure I have syntax correct I've temporarily hardcoded a column name in the Begin Render event of the chart...

Chart1.Series["S1"].ValueDataColumn = WorkOrders.DepartmentID

I only have one series in the chart and have also tried the following...
Chart1.Series[0].ValueDataColumn = WorkOrders.DepartmentID

Both cases give me the following error message...
"'Stimulsoft.Report.Chart.IStiSeries' does not contain a definition for 'ValueDataColumn' and no extension method 'ValueDataColumn' accepting a first argument of type 'Stimulsoft.Report.Chart.IStiSeries' could be found (are you missing a using directive or an assembly reference?)"

Can you provide direction on the syntax I should be using? Is what I am trying even possible?

Re: Dynamically Choose CHart Column

Posted: Mon Jun 05, 2017 1:47 pm
by Alex K.
Hello,

Please send us a sample which reproduces the issue for analysis.

Thank you.

Re: Dynamically Choose CHart Column

Posted: Mon Jun 05, 2017 3:45 pm
by cbrydon
Hi Aleksey,

Attached is a simple report and sample database. I misspoke in my first email - originally I said I tried
putting the expression in the Begin Render event of the chart, but I should have said the Begin Render
event of the Report. Either way I still get the same error message.

Hope you can help!

Thanks,
Carl

Re: Dynamically Choose CHart Column

Posted: Tue Jun 06, 2017 2:15 am
by Edward
Hi Carl,

Thank you for the sample report and data. Yes, that is possible.

Please set the DataSource property for the Chart1 to WorkOrders and use your varChartColumn variable in the Value property of the Chart as per the following screenshot :
ChartValueFromVariable.PNG
ChartValueFromVariable.PNG (109.35 KiB) Viewed 3188 times
DynamicChart2.mrt
(18.93 KiB) Downloaded 360 times
Thank you,
Edward

Re: Dynamically Choose CHart Column

Posted: Tue Jun 06, 2017 11:28 am
by cbrydon
Excellent Edward - Thank You!

Re: Dynamically Choose CHart Column

Posted: Tue Jun 06, 2017 5:26 pm
by Edward
Hi Carl,

You are welcome :)

Thank you,
Edward