Is there a ViewerClosed-Event?

Stimulsoft Ultimate discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Is there a ViewerClosed-Event?

Post by tpontow »

Hello,

is it possible to find out when the report viewer is closed? I need to make some memory deallocation after the user closed the report / report viewer. Or is there a better way and location to free some memory after the report is not longer open?

Thanks and kind regards
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Is there a ViewerClosed-Event?

Post by HighAley »

Hello.

Could you specify what Viewer do you use?

Thank you.
dvd
Posts: 2
Joined: Thu Oct 04, 2012 8:25 am

Re: Is there a ViewerClosed-Event?

Post by dvd »

I've a similar behavior: using latest version of Stimulsoft and Vb.Net over .Net 3.5 on a Windows Form application.

I use to load a list of with data to be rendered on the report and pass it, using the code below

Dim report1 As StiReport = Get_NewReport()
report1.Load(report)
report1.RegData(regDataName.ToString, data)
report1.ReportDescription = "DataName=" & regDataName.ToString

The memory usage is high but just because of the T-List is big, I was expecting a reduction of memory soon the report has been closed from the user but this doesn't happen. Please note I use to destroy the T-List and call GC.Collect soon after the report' .Show command. The only way is to shut down the Windows application (which is not an accetable solution=

Do you have any suggestion or work around to let the memory being freed?

Regards
dvd
Posts: 2
Joined: Thu Oct 04, 2012 8:25 am

Re: Is there a ViewerClosed-Event?

Post by dvd »

I've a similar behavior: using latest version of Stimulsoft and Vb.Net over .Net 3.5 on a Windows Form application.

I use to load a list of with data to be rendered on the report and pass it, using the code below

Dim report1 As StiReport = Get_NewReport()
report1.Load(report)
report1.RegData(regDataName.ToString, data)
report1.ReportDescription = "DataName=" & regDataName.ToString

The memory usage is high but just because of the T-List is big, I was expecting a reduction of memory soon the report has been closed from the user but this doesn't happen. Please note I use to destroy the T-List and call GC.Collect soon after the report' .Show command. The only way is to shut down the Windows application (which is not an accetable solution=

Do you have any suggestion or work around to let the memory being freed?

Regards
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Is there a ViewerClosed-Event?

Post by tpontow »

Hello,

i am using Stimulsoft.Reports.Ultimate and so i display my reports in Forms-, Wpf- and Silverlight-Environment. I'm using the respective Viewer which opens when calling the

Code: Select all

StiReport.Show() 
method. I'm using business objects and so i need to perform some memory deallocation tasks after the Viewer is closed by the application user.

Thanks
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Is there a ViewerClosed-Event?

Post by HighAley »

Hello.

The Show() method creates a new form and it's impossible to handle its event.
But you could call the StiReport.Show(true) then the Dialog window with Viewer will be created. Next code will be executed after the closing of the viewer.
The other way is to create your own form with StiVeiwerControl and handle the Close event of this form.

Thank you.
Post Reply