Export to JPG RadHtmlChart

6 posts, 0 answers
  1. Suresh Krishna
    Suresh Krishna avatar
    24 posts
    Member since:
    Sep 2009

    Posted 26 Nov 2013 Link to this post

    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
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 26 Nov 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Suresh Krishna
    Suresh Krishna avatar
    24 posts
    Member since:
    Sep 2009

    Posted 27 Nov 2013 Link to this post

    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
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1494 posts

    Posted 02 Dec 2013 Link to this post

    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.
  6. Suresh Krishna
    Suresh Krishna avatar
    24 posts
    Member since:
    Sep 2009

    Posted 10 Dec 2013 Link to this post

    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.?
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 11 Dec 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017