Click here to Skip to main content
Click here to Skip to main content
Go to top

Problem of Crystal Reports When Not Closing Report Document Object

, 5 Aug 2007
Rate this:
Please Sign up or sign in to vote.
This article is about Issue in Crystal report

Introduction

This article is about the space allocation problem that is caused by running Crystal reports in ASP.NET. It is about the files created in temp folder of system.

Background

I stuck with the problem of space in Windows temp folder for quite sometime when I was running Crystal reports in my ASP.NET application. Whenever I run a Crystal report, some files are loaded into my server temp (c:\windows\temp) folder. When that folder reaches a certain capacity, "Load Report Failed" error occurs. When I try to delete these files manually from temp folder, it gives an error notice:

"File cannot be deleted. It is being used by another person or program…." 

Using the Code

Whenever I run a Crystal report in my ASP.NET application, Crystal report file and some other files are created in temp folder. When that folder reaches a certain capacity, it gives "Load Report Failed" error.

When I try to delete those files manually from temp folder, they cannot be deleted and throw an error message:

"File cannot be deleted. It is being used by some other person or program.............." 

The only way to delete those files is to reboot the system and delete the files manually which is of course not the desired solution.

Finally, to resolve this problem, I have added the following line of code into the finally statement of the try catch block. This will automatically delete the files from temp folder.

// try {Use the report object and do load report etc.......} catch()
// {Handles exception here......} finally{NewReport.Close();} 

History

  • 6th August, 2007: Initial post

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Aftab Zaheer Satti
Software Developer
Pakistan Pakistan
No Biography provided

Comments and Discussions

 
GeneralThis is not a problem with Crystal Reports... PinmemberBrian Ensink6-Aug-07 9:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 6 Aug 2007
Article Copyright 2007 by Aftab Zaheer Satti
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid