Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports Windows\Temp files not deleting

Status
Not open for further replies.

toekneel

Programmer
Aug 10, 2001
96
US
We've been wrestling with this for awhile and finally found the answer to the problem. Figured I should post it here so that others could reap the benefits. Our program was built in Visual Studio 2005 but we have also experienced this problem with deploying Crystal Reports in a Visual Studio 2003 environment as well.

We had been noticing that the Windows\Temp file on the server was loading up with reports and other temporary files as reports were being run. When the folder hit a certain capacity, the good old "Load Report Failed" error would appear.

If we attempted to delete the files on the server, we'd get this error notice:

Cannot delete {FILENAME}: It is being used by another person or program. Close any programs that might be using the file and try again.

The only way we knew of to put a temporary fix on this was to reboot the server and then delete the files.

Finally, I stumbled upon this today and it cleared up our problem. I am going to go back and apply it to every application we have running on the server and make it standard from this point forward.

In the Finally statement of our Try Block in the code that actually displays the report, I added this small line of code:

MyReport.Close()

This took care of our problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top