Issue #752 new

Issue when exporting jqplot to excel??

ishwarya
created an issue

Hi I was trying to export the jqplot chart to excel file. I was able to export the chart values correctly but when i try to export the pie chart i am getting error in the excel file saying this image is "The linked image cannot be displayed..." here is the code that i tried:

$(".expToExcel").click(function () { var data = $('<img/>').attr('src', $('.chart3').jqplotToImageStr({})); data = escape(data); $('body').prepend("<form method='post' action='/EducationDashboard/ExportToExcel' style='top:-3333333333px;' id='tempForm'><input type='hidden' name='data' value='"+data+"'></form>"); $('#tempForm').submit(); $("tempForm").remove(); return false;

public void ExportToExcel() { string data = Request.Form["data"]; data = HttpUtility.UrlDecode(data); Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=report.xls"); Response.Charset = ""; Response.ContentType = "application/excel"; HttpContext.Response.Write(data); HttpContext.Response.Flush(); HttpContext.Response.End(); }

Can anyone please help me with this?