This is a migrated thread and some comments may be shown as answers.

Can I export a report to PDF programmatically in Medium Trust ASP.Net hosting?

1 Answer 119 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Klaus
Top achievements
Rank 2
Klaus asked on 03 Jun 2010, 05:09 AM
Can you export an existing report to PDF format in a medium trust environment?

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(); 
    }    

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 07 Jun 2010, 08:39 AM
Hello Klaus,

The PDF and Excel rendering extensions require UnmanagedCode permission to operate at all times. 

You can check out the Medium Trust Support article to find out more about the limitations and requirements for deploying an ASP.NET application containing Telerik Reporting on a web host that imposes Medium Trust permission level.

Sincerely yours,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Klaus
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or