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

pdf rendering format is not available

2 Answers 247 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
shak
Top achievements
Rank 1
shak asked on 13 May 2012, 02:05 PM
Hi, I am developing a mvc3 razor app where i am using telerik report. Look at the below program , when i run my app in local pc it works fine. but when i upload the site in the server it shows following error:
Telerik.Reporting.Processing.RendererNotAvailableException: pdf rendering format is not available.

I added Telerik.Reporting.dll into my app including bin folder.

 public ActionResult Rpt()
        {

            DataSet1 ds = new DataSet1();

            ds.DataTable1.Rows.Add("Imran""Milibagh");
            ds.DataTable1.Rows.Add("Sahk""Mouchak");
            ds.DataTable1.Rows.Add("Mohammad""Gulshan");
            ds.DataTable1.Rows.Add("Rana""Bogura");

            Report1 rp = new Report1();

            rp.DataSource = ds;


            ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
            RenderingResult renderingResult = reportProcessor.RenderReport("pdf", rp, null);

            MemoryStream ms = new MemoryStream();
            ms.Write(renderingResult.DocumentBytes, 0, renderingResult.DocumentBytes.Length);
            ms.Flush();

            FileContentResult result = new FileContentResult(ms.GetBuffer(), renderingResult.MimeType);
            result.FileDownloadName = "a.pdf";            

            return View();
        }

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 16 May 2012, 04:14 PM
Hi shak,

The PDF rendering extension require UnmanagedCode permission to operate at all times. If the permission is not present, PDF extension is disabled and removed from viewer's export options, however when you explicitly try to render to PDF with code you will get this error as the rendering engine cannot load the PDF rendering extension. In order to check if the required permission is granted our suggestion to add a report viewer and check if the PDF option is available in the export drop down. For more information on the required permissions check out the Medium Trust Support help article.

Kind regards,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

0
shak
Top achievements
Rank 1
answered on 17 May 2012, 05:47 AM
Hi Steve,
Thanks for your help. My problem is solved. I solved the problem by adding  <trust level="Full" /> into the web.config file.

 <system.web>
   <trust level="Full" />
 </system.web>
Tags
General Discussions
Asked by
shak
Top achievements
Rank 1
Answers by
Steve
Telerik team
shak
Top achievements
Rank 1
Share this question
or