Link to home
Start Free TrialLog in
Avatar of brokeMyLegBiking
brokeMyLegBiking

asked on

Is it safe to terminate a thread that is opening a cyrstal report?

I have a VB.NET windows application which kicks off a crystal report viewer and passes a crystal report object with a recordset to that viewer.

Sometimes this takes a long time. I would like to allow the user to cancel the report if they would like.

I plan to create the report in a second thread, and if the user hits a "Cancel" button, then the report creation process is cancelled. Will this have any negative effects on the client machine? Will it create orphaned files? Will it take up memory? Or will .NET magically clean up everything for me, and make it safe to terminate the thread before it is finished?


thanks so much for your help!
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

I would like to see your code on this one. In vb.Net there is no need to use recordsets, you should use datasets and you may need to pass Parameter Fields to the CR report.
"Sometimes this takes a long time ".... if it is taking that long to run there may be a better way to code this. Then you will not need to use threading.
Avatar of brokeMyLegBiking
brokeMyLegBiking

ASKER

I am using DataSets.  

The Access database is 1 gig. So it is a huge database. That is why it is sometimes slow.

I guess I need to understand what processes Crystal reports starts when it creates a report, and if it creates any temporary files that I need to delete when I end the process before it is finished.



ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial