Skip to Content
Former Member
Nov 11, 2013 at 02:16 PM

Correct way to Close a doc object to ensure memory is freed up



We have been developing a web reporting web site to hang off our bespoke management app and so far all had been working fine.

But recently we are getting regular errors thus

'The maximum report processing jobs configured by your system administrator has been reached'

After much Googlising it seems this is due to me not correctly closing the report document after finishing with the viewer. I read this article as the basis for my assumption

My code works by using non-embedded reports (external files) that are assign (Load) to a ReportDocument object which is in turn placed in a session variable and a new browser wind is opened (using Javascript) which opens the page with the viewer on it. The page with the viewer then reads the session object and assigns the ReportDocument contained within it to the ReportSource property of the viewer.

I can post the code if required.

My question is (are)

1. Is this an OK way to do things generally?

2. Once I am on the viewer page and have assigned the session variable (ReportDocument) to the ReportSource of the viewer, how can I then safely and fully close the document to ensure the memory is freed up? As It have passed the ReportDocument over is a session variable I am guessing I no longer have access to the original object (created on a different page) to ensure it gets released properly?

3. Or am I on the wrong track entirely as to the cause of this issue?

Many thanks in advance