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

How to Export multiple RadCharts to Excel?

4 Answers 171 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Madhan
Top achievements
Rank 1
Madhan asked on 25 Sep 2012, 06:20 AM
Hello Team,

I am building Dashboard application in Silverlight and using RadChart controls to build Dashboard.In Dashboard we have multiple Charts for showing Revenue,Units for each country.I have a requirement to export all Charts to Excel file.I have tried to use Export to excel functionality to export Chart and able to Export one Chart at a time.

Is there any way to Export all available Charts in a page at a time to Excel?Please provide let me know if we have any alternative way to achieve this Export Excel?

Thanks in Advance.

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 27 Sep 2012, 09:41 AM
Hello,

You can export more than 1 RadChart simultaneously by placing all of the charts in a container and then use the export-to-image extensions (part of Telerik.Windows.Controls.dll) to achieve the desired functionality like this:
Telerik.Windows.Media.Imaging.ExportExtensions.ExportToExcelMLImage(<your_container>, stream);

Hope this helps.

Regards,
Nikolay
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Madhan
Top achievements
Rank 1
answered on 06 Oct 2012, 06:14 PM
Hello Nikolay,

Thanks for your reply.As per your answer i have implemented code as below to export entire control as image but i am getting an error.Can you please help me how i can export entire charts to excel?

            SaveFileDialog dialog = new SaveFileDialog();
            dialog.DefaultExt = "xls";
            dialog.Filter = "*.xls | Excel";
            if (!(bool)dialog.ShowDialog())
                return;
            Stream fileStream = dialog.OpenFile();
            Telerik.Windows.Media.Imaging.ExportExtensions.ExportToExcelMLImage(obj.LayoutRoot, fileStream);
            fileStream.Close(); 

Here obj.LayoutRoot has many chart controls and i would like to export those charts into Excel.

Attached is Error i am getting,Please assist me.
0
Madhan
Top achievements
Rank 1
answered on 10 Oct 2012, 06:34 AM
Hello Team,

I am building Dashboard application using RadChart controls and I would like to export all chart countrols in a page using below code but i am getting "Invalid file filter format." exception.Can any one help me in this issue.

 SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = "xls";
dialog.Filter = "*.xls | Excel";
if (!(bool)dialog.ShowDialog())
return;
Stream fileStream = dialog.OpenFile();
Telerik.Windows.Media.Imaging.ExportExtensions.ExportToExcelMLImage(obj.LayoutRoot, fileStream);
fileStream.Close();

Here obj.LayoutRoot has many chart controls and i would like to export those charts into Excel.

If i removed line of code (dialog.Filter = "*.xls | Excel";) from above code,it will work but to save file we have to give file name with .xls or xlsx extention.

Attached is Error i am getting,Please assist me.
0
Nikolay
Telerik team
answered on 10 Oct 2012, 07:42 AM
Hello,

Please, try setting the SaveFileDialog in the following manner :
SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = "*.xls";
dialog.Filter = "Files(*.xls)|*.xls";
 
If the issue persists, it would be very helpful for us if you're able to zip and send us a sample application, demonstrating this issue, so that we can debug it locally and provide further support.

All the best,
Nikolay
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Madhan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Madhan
Top achievements
Rank 1
Share this question
or