I my application I displayed the linechart using Ajax ControlToolKit then i need to Export linechart to Excel sheet(open office/Libra office). Is it possible to do this? and tell me how can i do this. thank you.
aspx code:
ValueAxisLineColor="#D08AD9" BaseLineColor="#A156AB" Style="margin-right: 7px" >
KkPosted Jul 28, 2016, 2:46 AM
{
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "MTTraining-Accuracy.xls"));
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
base.OnPreRender(e);
ScriptManager sm = ScriptManager.GetCurrent(Page);
sm.RegisterScriptControl(LineChart1);
grdMTPerformance.AllowPaging = false;
grdMTPerformance.HeaderRow.Style.Add("background-color", "#FFFFFF");
for (int i = 0; i < grdMTPerformance.HeaderRow.Cells.Count; i++)
{
grdMTPerformance.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
}
LineChart1.RenderControl(htw);
grdMTPerformance.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
}
{
/* Verifies that the control is rendered */
base.OnPreRender(e);
ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);
if (scriptManager == null)
{
this.LineChart1.Visible = true;
scriptManager = new ScriptManager();
scriptManager.ID = "ToolkitScriptManager1";
scriptManager.EnablePartialRendering = true;
Controls.AddAt(0, scriptManager);
}
}
VenkatPosted Jul 22, 2016, 10:53 PM