I have some code that runs a report and exports it as a pdf to the end users browser from an ASP.net web application.
Here a sample of the code.
var report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
report.Load(HttpContext.Current.Server.MapPath("./Report.rpt"));
//code to populate report
report.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, false, Page.Title);
report.Close();
report.Dispose();
Response.End();
Everything works fine with the exception that it leaves behind a single temp file in the C:\Windows\Temp folder on the server. The file has a name like tmp7CE8.tmpis and is the pdf version of the report.
All the other temporary files that get generated by Crystal are removed once report.Close(); and report.Dispose(); are called.
This is filling up the C:\Windows\Temp folder and the files need to be manually deleted.
I know that I could setup a task to do this on a regular basis and we have as a temporary solution.
Should this file be left behind? I figured that since it was exporting directly to the Response stream that the temporary file would not be required once that has occurred.
I am using CrystalDecisions.13.0.0
Thanks.