Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Export Chart from WARP
posted

I have a WARP panel containing an web chart control.  On page load the chart is populated from a webservice.  I simply want to export this chart to PDF using the document exporter.  My export button is ouf of the WARP panel but when the button is clicked the chart becomes unbound and renders in pdf with the empty style properties (red text unbound etc...) 

I have looked into triggers etc... and using AJAX toolkit but no luck. Any help would be much appreciated

 

Parents
No Data
Reply
  • 420
    posted
    Following code works for Excel..for PDF you can change application/vnd.ms-excel... Server Side: /// /// Exports the Excel /// public void btnExport1() { if (Page.Request.Params.Get("__EVENTTARGET") == "Button1") { Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.Charset = ""; this.EnableViewState = false; System.IO.StringWriter oStringWriter = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter); grdTaskPlanning.RenderControl(oHtmlTextWriter); Response.Write(oStringWriter.ToString()); Response.End(); } //xlExporter.Export(grdTaskPlanning); } Client Side: In java script method ; __doPostBack("Button1","1"); oEvent.needPostBack = false; return true;
Children
No Data