Fault description:
Vs2005 Crystal Reports for Web ApplicationsProgramAfter multiple times of use, the loading of the report will fail. Restarting the Web server is normal again. After a while, the same problem may occur.
When you use a crystal report, a report loading error occurs.
At the beginning, the user was very normal, but when using the report for one day (the user used the report frequently), "Report loading failed" would occur, and then the user restarted the server.
I found that there are a large number of crystal report files in the temporary file C:/Windows/temp, and several files are generated every time you use them,
If the computer is not restarted, it will not be deleted, but a large number of useless files will appear,
I searched Google and found that some people encountered such a situation, but the answer was vague. I just said that I would close the file loaded with the crystal report,
It can be seen from this that such errors should be made by programmers.
The solution is as follows:
1. The reportdocumen instance must be a class member.
PrivateReportDocument prtp = new reportdocument ();
2. After using the crystal report, you must close the file so that it will not be generated in the temporary file of windows.
private void page_unload (Object sender, eventargs e)
{< br> prtp. dispose ();
}< br>
the page_unload event is run when the page is fully displayed.