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

Charts in a ReportViewer

2 Answers 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Darius
Top achievements
Rank 1
Darius asked on 08 Aug 2014, 09:45 PM
Is it possible to dynamically produce charts in a ReportViewer? (bar, pie, and line charts)
I managed to make RadCharts in a User Control, but I can't seem to produce anything inside a ReportViewer.
My data source (for the chart) is an array, and I'm using WPF.

2 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 13 Aug 2014, 02:29 PM
Hi Darius,

I believe we already discussed the same question in your support ticket #848137.


For anyone concerned, below is my reply from the ticket:

"Telerik report is a template repeated for the assigned to it data. Report can be created through our Report Designers, or dynamically.

Using the provided report designers will ease you to create the desired layout. When you use the integrated in Visual Studio Report Designer you will be able to get the auto-generated code in the report's designer.cs(vb) file and modify and reuse it to build a report from scratch.

The created report can be displayed in a WPF ReportViewer. an example of using the WPF ReportViewer is available in our local demos, installed by default under C:\Program Files (x86)\Telerik\Reporting Q2 2014\Examples\CSharp\WpfDemo.


If you need to specifically create a chart, you can use the Graph item and report designers to create the desired layout. Then just reuse the generated code.Each chart type has a description and tutorial how to create the chart - Chart Types.

With the given description, you can use the ObjectDataSource component to wrap the data model and pass the data to the Graph data item. More data-binding approaches are available in the How to use the ReportItem.DataObject property in expressions article.
"


I hope the information is helpful.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Darius
Top achievements
Rank 1
answered on 19 Aug 2014, 06:34 PM
It was exactly what I needed, thanks!

In case it might help anyone else: I had to set my List (which is the data source) as static, so that it provides as a global data source to both the ReportViewer and my other classes that populate it.
Tags
General Discussions
Asked by
Darius
Top achievements
Rank 1
Answers by
Stef
Telerik team
Darius
Top achievements
Rank 1
Share this question
or