Oops Posted April 24, 2007 Report Share Posted April 24, 2007 I am trying to implement a functionality wherein if the user clicks on a chart in the webpage, a new webpage opens up with an expanded version of the chart. Now my code looks like this MemoryStream mm = new MemoryStream(); ((Chart)PreviousPage.FindControl("Chart1")).Export(mm); Chart2.Import(mm ); But when i run this i get a exception like so : System.IndexOutOfRangeException was unhandled by user code Message="Index was outside the bounds of the array." Source="ChartFX.WebForms" at the 3rd line where i do the import. Can anyone help in pointing out what might be wrong here. Thanks. Link to comment Share on other sites More sharing options...
Frank Posted April 24, 2007 Report Share Posted April 24, 2007 After export, the position in the stream is at the end of it, that's the reason Import fails. you need to do: mm.Position = 0; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.