Can you export an existing report to PDF format in a medium trust environment?
Will the following code work on Medium Trust?
Will the following code work on Medium Trust?
| void ExportToPDF(Telerik.Reporting.Report reportToExport) |
| { |
| ReportProcessor reportProcessor = new ReportProcessor(); |
| RenderingResult result = reportProcessor.RenderReport("PDF", reportToExport, null); |
| string fileName = result.DocumentName + ".pdf"; |
| Response.Clear(); |
| Response.ContentType = result.MimeType; |
| Response.Cache.SetCacheability(HttpCacheability.Private); |
| Response.Expires = -1; |
| Response.Buffer = true; |
| Response.AddHeader("Content-Disposition", |
| string.Format("{0};FileName=\"{1}\"", |
| "attachment", |
| fileName)); |
| Response.BinaryWrite(result.DocumentBytes); |
| Response.End(); |
| } |