Dynamically Choose CHart Column

Stimulsoft Reports.WEB discussion
Post Reply
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

Dynamically Choose CHart Column

Post 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?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Dynamically Choose CHart Column

Post by Alex K. »

Hello,

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

Thank you.
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

Re: Dynamically Choose CHart Column

Post 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
Attachments
sample.zip
(543.99 KiB) Downloaded 466 times
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Dynamically Choose CHart Column

Post 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 3187 times
DynamicChart2.mrt
(18.93 KiB) Downloaded 360 times
Thank you,
Edward
cbrydon
Posts: 176
Joined: Fri May 30, 2014 4:37 pm

Re: Dynamically Choose CHart Column

Post by cbrydon »

Excellent Edward - Thank You!
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Re: Dynamically Choose CHart Column

Post by Edward »

Hi Carl,

You are welcome :)

Thank you,
Edward
Post Reply