TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
P B
NA
1
2.9k
Crystal Reports not unloading properly from memory
Jun 29 2012 9:59 AM
Hi. Here's the problem i'm running into (VS 2010, .net 3.5, Crystal Reports 2008):
I've got a form, frmReports, that has a CrystalReportsViewer control on it. This form is instanced by a button_click from another form. Upon loading frmReports loads a report document into the viewer, which takes at least 3 minutes to display (the efficiency is not in question here; the database is very large and the report uses a stored procedure).
For this reason i have created a background worker that checks for a keyboard combination. This is supposed to prompt the user that he has chosen to interrupt the loading, dispose of everything and close the form (frmReports).
Everything works very well, the key event is sent, the user is notified(the background worker is disposed properly), but after pressing OK to close the messagebox, the main thread remains locked (i cannot do anything on any form).
I've used ANTS memory profiler and all the CrystalDecisions assemblies are still loaded into the memory, and the report document is actually still working in the background.
I've tried crViewer.ReportSource.Close(), setting it to = nothing, ReportSource.Database.Dispose(), changing the AppDomain and unloading the assemblies, forcing GC.Collect(), and many combinations, and NOTHING WORKED - the report still doesn't release its resources and keeps on trying to load in the background (i think in some unmanaged thread as pausing my program doesn't interrupt anything).
Is there any way to properly unload everything Crystal Reports loaded? or to forcibly close the connection to the database (without doing anything to the sql server)??
Reply
Answers (
0
)
how to retrieve checked value of checkbox from sql server 2005 using C# on windows form
i want to retreive data in textboxes from datagridview in windows application