eromurugan Posted May 7, 2010 Report Share Posted May 7, 2010 Hi, I have web page with multiple Chart FX 7.0 Controls in it. I want to export all the content in a container like Panel to excel. Panel contains the charts. I am using the following code to achieve it. string exportContent = string.Empty; HttpResponse response = CreateExcelFile(fileName);using (StringWriter sw = new StringWriter()) { using (HtmlTextWriter htw = new HtmlTextWriter(sw)) {HtmlTable t = new HtmlTable(); HtmlTableRow top = new HtmlTableRow();HtmlTableCell tcell = new HtmlTableCell(); tcell.Controls.Add(control); top.Cells.Add(tcell); t.Rows.Add(top); t.RenderControl(htw); HttpContext.Current.Response.Write(sw.ToString());HttpContext.Current.Response.End(); } } I am getting error Object Reference not set at line t.RenderControl(htw);Please help me. Thanks in advance. 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.