Under Review
Last Updated: 15 Aug 2022 15:41 by ADMIN
Aleksandar
Created on: 09 Aug 2022 01:53
Type: Bug Report
0
DisposeViewerResources displays "Object reference not set to an instance of an object." dialog

I display the WPF Report Viewer control in a closable tab. To free the resources I invoke DisposeViewerResources on tab close as described here: https://docs.telerik.com/reporting/embedding-reports/display-reports-in-applications/wpf-application/disposing-the-report-viewer-resources

However, I see the following dialog every time. There is no way to capture this error or suppress the dialog.

2 comments
ADMIN
Dimitar
Posted on: 15 Aug 2022 15:41

Hi Aleksandar,

Thank you for the update with the workaround!

We will have that in mind while investigating whether the behavior in the described scenario should be changed.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Aleksandar
Posted on: 09 Aug 2022 12:40
I was able to solve this by calling DisposeViewerResources() from within ReportViewer.Dispatcher.BeginInvoke(). The UI thread is most likely being accessed from within DisposeViewerResources().