PDF Render sometimes causes System.ObjectDisposedException: Cannot access a disposed object.

1 Answer 16 Views
.NET Framework Converters Programming Rendering Serialization
David
Top achievements
Rank 1
David asked on 02 Apr 2025, 05:23 PM

When trying to render our telerik reports into PDF we sometimes get an error System.ObjectDisposedException: Cannot access a disposed object.

The version of Telerik.Reporting library we are currently using is 18.3.24.1112.

We checked the data being applied to the report and none of our objects are being disposed before being applied. 

I noticed that there was a memory leak fix to pdf rendering that occurred in version 18.3.24.1218.

Could this be the cause of the error or could it be something else?

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 07 Apr 2025, 02:51 PM

Hello David,

Can you elaborate on your scenario? Do you render the report with code - Generating Reports Locally with Code? Or do you preview them in a viewer? Do you use a Reporting REST Service?

The error indicates a disposed object. If you attach a Trace Listener to the project rendering the reports, we may get more details. For example, which is our method that throws.

I cannot say whether the memory improvements we made are related to the experienced issue. The Trace log may clarify this.

Do you use an ObjectDataSource?  If so, can you send it for local investigation? For example, you may attach it to a Support Ticket.

Regards,
Todor
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

David
Top achievements
Rank 1
commented on 08 Apr 2025, 03:52 PM | edited

Hi Todor,

Is there an option for me to directly DM you this information? 

We render the report with code. 

We currently log everything to Grafana

We use an ObjectDataSource though we don't have the specific data that caused this error. 


Todor
Telerik team
commented on 09 Apr 2025, 11:49 AM

Hi David,

As explained in the Support Ticket you opened on the issue, it may indeed be relevant to the fixed regression - Font objects leak memory when reports are rendered to PDF.

Our suggestion is to upgrade to our latest version or downgrade to 18.2.24.924, where the problem does not reproduce.

If the problem persists with the suggested Reporting versions, we will ask you for more information for further investigation.

 

Tags
.NET Framework Converters Programming Rendering Serialization
Asked by
David
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or