Jump to content
Software FX Community

Object Reference Not Set Error on RenderControl() method


eromurugan

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...