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

How to customize a new chart with wizard

3 Answers 105 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Khoa Ho
Top achievements
Rank 1
Khoa Ho asked on 31 Jan 2013, 10:35 PM
Hi,

I am working to convert all Crystal Reports to Telerik Reports. And I see that the Telerik Chart Builder Wizard does not allow to narrow down only selected fields to display on the chart like Crystal Reports (see the attached snapshot). I am new to customize Telerik Report charts and need help to create a pie chart (like the attached image). How can I select only needed fields from a big data source and use aggregate SUM function to display a pie chart with field names shown in the legend.

Thank you for your support.
Khoa

3 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 04 Feb 2013, 01:56 PM
Hi Khoa, 

You can either build the series and items programmatically by iterating through the items from the data-source or alter your data-source. For e.g, instead of getting different fields, of data, you want to sum up, you can sum them up in the query and present them as if they were different rows of the same table.

Instead of selecting

Field1, Field2, Field3
...       ...   ...
...           ...         ...
...           ...     ...

select  
[Column1]
Sum(Field1)
Sum(Field2)
Sum(Field3)

This way, you will be able to bind the data directly to the Pie series and get the desired result. 

For the programmatic approach you can refer to:

All the best,
Elian
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Khoa Ho
Top achievements
Rank 1
answered on 05 Feb 2013, 04:11 PM
Hi Elian,

One thing I found out I can't set DataSource on Properties at the design window because it will get all fields, not selected fields from a big data source. Therefore, I have to bind data from data source to selected fields on code behind. But I still don't know how to build a data view from data source (Telerik.Reporting.SqlDataSource class). I need only one big data source for one call to database, and many data views for many different charts.

Thank you for your support.
Khoa
0
Elian
Telerik team
answered on 08 Feb 2013, 09:16 AM
Hello Khan,

The SqlDataSource component is built to support the Data Items used in the report and it is not meant to be executed manually. In your case it is better to select the data programmatically (using SqlDataAdapter for e.g.) and use DataSet / DataTable to keep the data and manipulate it however you need to. 
 

Regards,
Elian
the Telerik team

HAPPY WITH REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Tags
General Discussions
Asked by
Khoa Ho
Top achievements
Rank 1
Answers by
Elian
Telerik team
Khoa Ho
Top achievements
Rank 1
Share this question
or