public void ExportReport_Mod_II(Payment_Summary_Monthly_mod_II rpt) { /* Create Main Folder for Detected Images of Contact Leasing */ string mainDirectory = "Payment_Summary_Monthly_II"; string mainDirectoryPath = "C:/ReportExport/" + mainDirectory; if (!Directory.Exists(mainDirectoryPath)) { Directory.CreateDirectory(mainDirectoryPath); } string FilePath = "C:/ReportExport/" + mainDirectory + "/Monthly_" + DateTimeUtility._dateToFile() + ".pdf"; if (File.Exists(FilePath)) { File.Delete(FilePath); } /// Export Report to PDF File with Save As Mode rpt.ExportToDisk(ExportFormatType.PortableDocFormat, @"C:/ReportExport/" + mainDirectory + "/Monthly_" + DateTimeUtility._dateToFile() + ".pdf"); /// Display PDF File to PDF Program /// Process process = new Process(); /// process.StartInfo.UseShellExecute = true; /// process.StartInfo.FileName = FilePath; /// process.Start(); WebClient User = new WebClient(); Byte[] FileBuffer = User.DownloadData(FilePath); if (FileBuffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", FileBuffer.Length.ToString()); Response.BinaryWrite(FileBuffer); } User.Dispose(); rpt.Dispose(); GC.Collect(); }