cancel
Showing results for 
Search instead for 
Did you mean: 

Error while disposing ReportClientDocument during postback

Former Member
0 Kudos

Hi,

My web application is develop using the following:

- VS2013, most web pages uses a master page.

- CRforVS (13_0_14), use just to create a report document and preview result on developer machine. no reference of this assembly in my web.config.

- BOE 4.0, these objects I use to preview reports at runtime, below is a sample reference on my web.config file.

  <add assembly="CrystalDecisions.CrystalReports.Engine, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" /> etc

- Windows 7 32-bit developer machine

- All report documents are deployed in Crystal Report Server (BOE 4.0) and my web app access it without any issue.

Problem:

I have experience 'Not anough memory' during peak hours, I have notice that the report object (ReportClientDocument) is not properly dispose.

My action:

Created a javascript that will trigger a postback event whenever the user close the report page, then from the server-side code of that (page_init event triggered) I dispose the report objects(see my sample code).

This works fine to all pop-up report-pages that are not belong to master page.

Issue:

Now using the same code I use on report pages belong to master page, it gives me an error (see below)

I notice that the value of "theForm.onsubmit" is null.

Hope you can give me a solution or other workaround to get out of this.

Thanks,

Erwin

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Erwin,

Likely what is happening is because you are closing/disposing the report on Page_init you have lost the report in that session.

Try moving that code to the Page_close event so the report stays in session while the page is active. Then in your main page the report would still be in session I believe....

Don

Former Member
0 Kudos

Hi Don,

Thanks for the reply.

Actually, the error happens just before the loading completion of the content page. It immediately pop up the error message. During debugging, it doesn't even reach my code in page_init event (code that dispose the cr object)

To give further info, on the same application, the same code and I use in some pages (also in page_init event) that does not belong to a master page , the code runs without any issue and dispose the cr object properly.

It seems that master page has something to do with it.

Answers (0)