This is a migrated thread and some comments may be shown as answers.

Build chart with object data source

2 Answers 255 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Datafyer
Top achievements
Rank 1
Veteran
Datafyer asked on 11 Feb 2011, 10:41 PM
I am attempting to convert some SSRS reports over to Telerik Reporting and mostly things are going well. However, I am having some difficutly with charts.

Basically, what I want is to display a row of data and then display a pie chart pertaining to the data. I can not figure out how to load the pie chart with only the data pertaining to the given row. All the examples I have seen use the NeedDataSource event and load global data or pass report parameters. However, I would like to display this chart for each detail item.

2 Answers, 1 is accepted

Sort by
0
Datafyer
Top achievements
Rank 1
Veteran
answered on 14 Feb 2011, 09:39 PM
I ended up getting a working solution, but I am not sure if it is the best one.

I created a sub report which contained my chart. I then passed the parameters in to the sub report which were the unique ids for the parent groups. I then used these parameters to calculate the chart data in the NeedDataSource event for the entire sub report. One gotcha for the whole thing is during the event the current object does not have the parameters, but the sender of the event does.

Please respond with any easier ways. It would be nice to do everything like this in one report and have the report engine figure things out. At least that is what Crystal and SSRS do. I still do like Telerik Reporting better than Crystal and SSRS so I am not complaining.
0
Peter
Telerik team
answered on 16 Feb 2011, 05:41 PM
Hello Patrick,

Based on your scenario description our suggestion is to add Chart item to the Table row and set the Chart.DataSource property with Binding to a datasource field or nested collection. This approach is more straightforward then the Subreport's one.

About the Report Parameters the sender of the event is always the processing counterpart. The definition ReportParameter.Value is the default value while the processing ReportParameter.Value is the actual value.

Check out the following help articles:

Best wishes,
Peter
the Telerik team
Tags
General Discussions
Asked by
Datafyer
Top achievements
Rank 1
Veteran
Answers by
Datafyer
Top achievements
Rank 1
Veteran
Peter
Telerik team
Share this question
or