Click here to Skip to main content
14,302,993 members

Problem of Crystal Reports When Not Closing Report Document Object

Rate this:
1.88 (7 votes)
Please Sign up or sign in to vote.
1.88 (7 votes)
5 Aug 2007CPOL
This article is about Issue in Crystal report


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.


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();} 


  • 6th August, 2007: Initial post


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


About the Author

Aftab Zaheer Satti
Software Developer
Pakistan Pakistan
No Biography provided

Comments and Discussions

GeneralThis is not a problem with Crystal Reports... Pin
BrianE6-Aug-07 9:59
memberBrianE6-Aug-07 9:59 

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

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

Posted 5 Aug 2007


7 bookmarked