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

Export Chart Report to Excel with editable chart not image

2 Answers 212 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
zxp
Top achievements
Rank 1
zxp asked on 04 Dec 2012, 08:48 AM
Hi,

I want to export a chart report to excel. Right now exporting works fine. A new requirement is to edit the chart in the excel. Right now it will export a image for the chart. How can I export real chart, not image to excel? 

Here is my exporting code:
var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
                Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("xlsx", report, null);

                string fileName = user_keyid + "_" + project_id + @"\" + Guid.NewGuid().ToString() + "." + extstr;
                if (!System.IO.Directory.Exists(AppDomain.CurrentDomain.BaseDirectory + user_keyid + "_" + project_id))
                {
                    System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + user_keyid + "_" + project_id);
                }
                var fs = new System.IO.FileStream(AppDomain.CurrentDomain.BaseDirectory + fileName, System.IO.FileMode.OpenOrCreate);

                fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);

                fs.Flush();

                fs.Close();

Any help will be appreciated!

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Dec 2012, 09:45 AM
Hello zxp,

The behavior you observe is by design and cannot be changed. Chart report items are rendered as an Excel Picture object and not Excel Chart object. In Microsoft Excel 97-2003 it is a Bitmap image; in Microsoft Excel 2007 and above it is a Metafile. This information is available in the Design Considerations for Excel Rendering help article.

Greetings,
Steve
the Telerik team

HAPPY WITH TELERIK 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
zxp
Top achievements
Rank 1
answered on 04 Dec 2012, 10:51 AM
Thanks for the quick post. Seems like I have to draw the excel chart myself using the report data source.
Tags
General Discussions
Asked by
zxp
Top achievements
Rank 1
Answers by
Steve
Telerik team
zxp
Top achievements
Rank 1
Share this question
or