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

2 posts, 0 answers
  1. Klaus
    Klaus avatar
    5 posts
    Member since:
    Apr 2009

    Posted 03 Jun 2010 Link to this post

    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(); 
        }    
  2. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 07 Jun 2010 Link to this post

    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.
  3. DevCraft banner
Back to Top