Jump to content
Software FX Community

Object reference not set to an instance of an object


W.D
 Share

Recommended Posts

Hi,

I'm developing windows based application to create and export a large number of charts to JPEG image stream and then write to database. I found after a few successful export, I will get the error message "Object reference not set to an instance of an object" when the code executed to the line of " SoftwareFX.ChartFX.Internet.Server.Chart thisChart=new SoftwareFX.ChartFX.Internet.Server.Chart();".

My sample code is below. My application in windows based, but I used SoftwareFX.ChartFX.Intenet.Server.Chart because I want to use the Export method to export JPEG image. I create the chart in memory.

But even though I called thisChart.Dispose() and thisChart==null. I still keep getting this error. Please help.

**********************************************************

for (int i=0; i<100; i++)

{

using (SoftwareFX.ChartFX.Internet.Server.Chart thisChart=new SoftwareFX.ChartFX.Internet.Server.Chart())

{

  System.IO.MemoryStream ms=new System.IO.MemoryStream();

  thisChart.Export(SoftwareFX.ChartFX.Internet.Server.FileFormat.Jpeg, ms);

}

}

 

 Regards,

W.D

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...