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

Export to JPG RadHtmlChart

5 Answers 222 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Suresh Krishna
Top achievements
Rank 1
Suresh Krishna asked on 26 Nov 2013, 10:36 AM
Hi All,

i have a requirement here. Need to Export the RadHTMLChart to jpg. Is there any option to do that?

please Let me know.

regards

Suresh

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Nov 2013, 10:59 AM
Hi Suresh,

The following code library entry provides information about exporting RadHtmlChart: http://www.telerik.com/community/code-library/aspnet-ajax/html-chart/exporting-radhtmlchart-to-png-and-pdf.aspx.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Suresh Krishna
Top achievements
Rank 1
answered on 27 Nov 2013, 01:01 PM
Hi Marin,
Thank you for the reply, I installed inkscape and tried exporting to (.png) format, where inkscape.Start() is not creating the png file but  temp.svg file is created and I ended with 'FileNotFoundException was Caught' in ReadFile Function.
 Is this something to do with the inkscape.exe application? And the sample site in the thread (ExportRadHtmlChart-VB.zip) was working.
Dim inkscape As New Process()
inkscape.StartInfo.FileName = HtmlChartExportSettings.InkscapePath
inkscape.StartInfo.Arguments = [String].Format("--file ""{0}"" --export-{1} ""{2}"" --export-width {3} --export-height {4}", settings.SvgFilePath, settings.Extension, settings.OutputFilePath, settings.Width, settings.Height)
inkscape.StartInfo.UseShellExecute = True
inkscape.Start()
inkscape.WaitForExit()

Thanks,
Suresh
0
Danail Vasilev
Telerik team
answered on 02 Dec 2013, 12:41 PM
Hi Suresh,

The error message doesn't seem to be related to RadControls but to the export settings of inkscape software. It may be possible that either a wrong SvgFilePath is passed to the inkscape.StartInfo.Arguments property in ExportHtmlChart() sub or the first argument (i.e. filePath) of ReadFile()  function is modified, so that the output SVG image cannot be passed to the inkscape for exporting.

I have created a short video that illustrates the proper functionality of the provided code library. The only change that I have made is the InkscapePath variable in HtmlChartExportSettings.vb file that references the path to the Inkscape executable on the server. What I can suggest is that you either reuse the provided code library and just modify the path to inkscape or proceed further with the debugging on this regard.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Suresh Krishna
Top achievements
Rank 1
answered on 10 Dec 2013, 06:50 AM
Hi Danail,
Thanks for the response, the issue is resolved. Actually the error was from my side , i was trying to hide the div which caused this problem. Now the export to .png is working good. But am having another issue, where a windows dialog appears to open or save the file .i think this is caused by the __doPostBack() method in javascript , is there any way to suppress that.?
0
Marin Bratanov
Telerik team
answered on 11 Dec 2013, 10:35 AM
Hello Suresh,

Once you send a file to the browser it is up to the browser to decide what to show and how to handle it. What you can control is the content-dispsition header - whether the file is inline or opens as an attachment.


Regards,
Marin Bratanov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (HTML5)
Asked by
Suresh Krishna
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Suresh Krishna
Top achievements
Rank 1
Danail Vasilev
Telerik team
Share this question
or