We had a problem in our ASP.Net application, where the Crystal Reports engine leaves garbage .tmp files in the Temp folder of the server after creating reports for users.
So, we are trying to figure out how to run the .Close () and .Dispose () methods of the Report object, but we find that the code does not start after export.
MyReport.Report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, this.Response, true, "My_Report"); MyReport.Report.Close(); MyReport.Report.Dispose();
The breakpoints set on the last two lines never hit, and we also tried to put different code to check the processing. None of this is happening. (I also saw this question on other sites with similar code, but did not answer)
I assume that the ExportToHttpResponse method returns the file stream (PDF) to the user at this point, ending the processing, so the rest of the code does not run. If this is the case, how can we get CR to clean up the temporary files that should be done by the Close () and Dispose () methods? Do we need to perform manual cleaning after the fact?
source share