Jump to content
Software FX Community

Object reference not set to an instance of an object.


sachinj
 Share

Recommended Posts

Hi,

I am dynamically creating a chart and I am getting the object reference error when I try to run the following code:

System.IO.

StringWriter MyTextWriter = new System.IO.StringWriter();HtmlTextWriter MyHtmlWriter = new HtmlTextWriter(MyTextWriter);chart1.RenderControl(MyHtmlWriter); //Crashes here with the above error

 It works fine some times but crashes other times. I am not able to figure out the reason for the crash. Can anyone provide me with any more insight.

Thanks.

Sachin

 Here is the call stack for the crash.:

 

Object reference not set to an instance of an object. at ChartFX.WebForms.Internal.b.a(OutputText A_0, Exception A_1, IServerControl A_2) at ChartFX.WebForms.Chart.a(Stream A_0, IOutputWriter A_1, OutputText A_2, OutputText A_3, OutputInfo A_4) at ChartFX.WebForms.Chart.a(OutputText A_0, OutputText A_1, Boolean A_2, String A_3, String A_4) at ChartFX.WebForms.Chart.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

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.

 Share

×
×
  • Create New...