We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfChart GetStream() throws Exception

I'm currently using the SfChart.GetStream() method to get an image of the chart and print it to a pdf later. Often but not always i get the following:


ChartDependencyService.GetStream (Syncfusion.SfChart.XForms.SfChart chart)

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Syncfusion.SfChart.XForms.Droid.SfChartExt'.


CANNOT ACCESS A DISPOSED OBJECT. OBJECT NAME: 'SYNCFUSION.SFCHART.XFORMS.DROID.SFCHARTEXT'.
  • 1
    JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self)
  • 2
    JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
  • 3
    View.set_DrawingCacheEnabled (System.Boolean value)
  • 4
    ChartDependencyService.GetStream (Syncfusion.SfChart.XForms.SfChart chart)
  • 5
    SfChart.GetStream ()
  • 6
    AuditOverviewView.SaveChart ()
  • 7
    (wrapper delegate-invoke) :invoke_void ()
  • 8
    BaseViewModel.RequestChartImageStream ()
  • 9
    AuditCentralPageViewModel.<get_FinalizeCommand>b__42_0 ()
  • 10
    <.ctor>b__0 (System.Object o)
  • 12
    AuditCentralPage+<ShowFinalizeDialog>d__1.MoveNext ()
  • 13
    ExceptionDispatchInfo.Throw ()


I think it might have something to do with the fact, that i use the GetStream() call not only when the page with the chart is active, but also when there is another page modally presented above the page with the chart. I want to get the image and create the pdf in this modally presented page too. My guess is, the chart is disposed internally cause its not displayed currently and thus the exception is thrown when calling the SfChart.GetSTream() method.So my question is, are my assumptions correct? What way is there around this, besides only calling the GetStream() Method when the ChartPage is active.esides only calling the GetStream() Method when the ChartPage is active.

1 Reply

PS Parthiban Sundaram Syncfusion Team June 16, 2017 03:52 AM UTC

Hi Simon,

Thanks for your interest in Syncfusion components.

We were able to reproduce the reported issue at our end. A support incident has been created under your account and we request you to login into our Direct Trac support system for further updates on this issue. Our Direct Trac support system can be accessed from the following link:

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Regards,
Parthiban S

Loader.
Up arrow icon