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

Posted on 2005-04-16
Last Modified: 2010-04-23
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!
Question by:brokeMyLegBiking
    LVL 27

    Expert Comment

    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.
    LVL 4

    Author Comment

    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.

    LVL 27

    Accepted Solution

    I sounds like you may need to focus on using SQL statements in your CR report to split up the info that is coming in from the database. May be taking to long to search and retreive info..

    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Article by: Kraeven
    Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now