kurkure Posted November 6, 2008 Report Share Posted November 6, 2008 Hi Quote Link to comment Share on other sites More sharing options...
TomasT Posted November 6, 2008 Report Share Posted November 6, 2008 Hi, Chart FX FX does not have a built-in feature to export charts to excel. Can you please provide some details? Are you exporting as bitmap or a metafile and simply adding that image to an excel sheet? Thanks, TT Quote Link to comment Share on other sites More sharing options...
shane2004 Posted November 17, 2008 Report Share Posted November 17, 2008 I used this to export as excel format, HTH private void ExportToExcel(string strFileName, DataView dv) { Response.ClearContent();Response.AddHeader("content-disposition", "attachment; filename=" + strFileName); Response.ContentType = "application/excel";System.IO.StringWriter sw = new System.IO.StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); //Instantiate a datagridSystem.Web.UI.WebControls.DataGrid dg = new System.Web.UI.WebControls.DataGrid(); dg.DataSource = dv; dg.DataBind(); //Tell the datagrid to render itself to htmltextwriterdg.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); } Quote Link to comment Share on other sites More sharing options...
TomasT Posted November 20, 2008 Report Share Posted November 20, 2008 Hi, Thanks for the additional info. Unfortunately, I don't believe this approach will work with Chart FX. While the DataGrid Control ultimately renders as an HTML table, the generated charts are basically images. The RenderControl call for the chart object returns the HTML that refers to an image on the server. You may want to work with the Office libraries instead in order to create a new Excel file with an embedded image. I found some information on line that may be of help: http://vb.net-informations.com/excel-2007/vb.net_excel_2007_insert_picture.htm regards, TT Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.