How to Export multiple RadCharts to Excel?

5 posts, 0 answers
  1. Madhan
    Madhan avatar
    19 posts
    Member since:
    Aug 2012

    Posted 25 Sep 2012 Link to this post

    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.
  2. Nikolay
    Admin
    Nikolay avatar
    386 posts

    Posted 27 Sep 2012 Link to this post

    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.

  3. DevCraft banner
  4. Madhan
    Madhan avatar
    19 posts
    Member since:
    Aug 2012

    Posted 06 Oct 2012 Link to this post

    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.
  5. Madhan
    Madhan avatar
    19 posts
    Member since:
    Aug 2012

    Posted 10 Oct 2012 Link to this post

    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.
  6. Nikolay
    Admin
    Nikolay avatar
    386 posts

    Posted 10 Oct 2012 Link to this post

    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.

Back to Top
DevCraft banner