When i run the following code a pdf is created but it will not open. When i try to open it manually by double clicking on it an error which says that adobe can not open the file because it has been corrupted somehow . . . . . . .
The commented out lines are things that I have tried.
The commented out lines are things that I have tried.
Telerik.Reporting.Report Telrpt =
new
TelRptContract();
Telerik.Reporting.Processing.ReportProcessor TelContractrp =
new
Telerik.Reporting.Processing.ReportProcessor();
System.Collections.Hashtable deviceInfo =
new
System.Collections.Hashtable();
Telerik.Reporting.InstanceReportSource TelContractirs =
new
Telerik.Reporting.InstanceReportSource();
TelContractirs.ReportDocument = Telrpt;
Telerik.Reporting.Processing.RenderingResult result = TelContractrp.RenderReport(
"PDF"
, TelContractirs, deviceInfo);
string
fileName2 = result.DocumentName +
"."
+ result.Extension;
//string path2 = "c:\\Users\\akinw\\Desktop\\";
//string path2 = System.IO.Path.GetTempPath();
string
path2 = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string
filePath2 = System.IO.Path.Combine(path2, fileName2);
FileStream fs =
new
FileStream(filePath2, FileMode.Create);
fs.Close();
//fs = File.Open(filePath2, FileMode.Open);
System.IO.File.Open(filePath2, FileMode.Open);