Insert a pdf into telerik reporting

12 posts, 0 answers
  1. Sebastien AUROUX
    Sebastien AUROUX avatar
    34 posts
    Member since:
    Sep 2008

    Posted 27 Feb 2013 Link to this post

    Hello
    Is it possible to insert a pdf into telerik reporting ? I have a set of reports generated using telerik reporting in pdf format and i want to append another generated pdf. Do you have this feature ?
    thanks
  2. Matthias
    Matthias avatar
    9 posts
    Member since:
    Feb 2011

    Posted 27 Feb 2013 Link to this post

    Would be great if this would be possible! Thumb up for it... It is useful for static pages with a complex layout...
  3. Tomas
    Tomas avatar
    92 posts
    Member since:
    Jun 2010

    Posted 28 Feb 2013 Link to this post

    I think it's been answered before that you have to use a third-party tool for this. But you're right it would be a nice to have feature.

    Tomas
  4. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 02 Mar 2013 Link to this post

    Hi everyone,

    The feature is not supported in Telerik Reporting as the main goal is data presentation which includes exporting it to various formats. Merging already created PDF files or byte streams can be performed with another software (you can check the forum for other members post about their choice). If you need to unite several reports on export, we can suggest you to use the ReportBook document where you can add different report definitions and export them at once in a single PDF document without additional file merges.

    Let us know if you have nay further questions.

    Greetings,
    Stef
    the Telerik team

    See what's new in Telerik Reporting Q1 2013. Register for the March 4 webinar to witness the impressive new visualizations in Telerik Reporting. Just for fun, 10 webinar attendees will be randomly selected to win a Telerik T-shirt and a $50 Gift Certificate to ThinkGeek. Register now! Seats are limited!

  5. Andy
    Andy avatar
    31 posts
    Member since:
    Nov 2010

    Posted 19 Jun 2013 Link to this post

    I agree, this would be a nice feature.  I have a requirement for including documents (pdf, doc, etc.) as part of a report. 
  6. Mark
    Mark avatar
    9 posts
    Member since:
    Aug 2012

    Posted 31 Oct 2016 Link to this post

    Hey guys

    I know I'm late to the party, but has there been any update on this?  While I did read the reply from Stef, I think this would be an awesome feature to have, and would address a large short-fall that I've found in T-Reporting...

    I basically need an advanced HTML control to render inside a report.  Since T-Reporting couldn't do this (table layouts, etc.), I have created my own PDF using the Rad Editor export to PDF.  I now need to imbed it into my report...

    any ideas?

  7. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 31 Oct 2016 Link to this post

    Hello Mark,

    Merging already existing files in a report or rendering of HTML documents is not supported. The workarounds I can suggest you are:
    1. Export the HTML as an Image and use a PictureBox item in the report. Please consider the example here.
    2. Export reports programmatically and merge documents via Telerik Document Processing Libraries.
    3. Use Telerik UI for AJAX or Telerik Kendo UI to export HTML in image, PDF formats - ClientExportManager.


    Regards,
    Stef
    Telerik by Progress
    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 Feedback Portal and vote to affect the priority of the items
  8. Jaw
    Jaw avatar
    1 posts
    Member since:
    Nov 2013

    Posted 10 Jan 2017 Link to this post

    I vote for this feature :-P

    there are some business scenario, which we have to generate report and attach some pdf scan data. f.i. #)expenses report with invoice

    #)import summary with customs-document

    ;-)

  9. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 10 Jan 2017 Link to this post

    Hi Jaw,

    Thank you for this feedback.

    Please check Telerik Document Processing Libraries which allow you to import, merge and export PDF files.

    Regards,
    Stef
    Telerik by Progress
    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 Feedback Portal and vote to affect the priority of the items
  10. Michael
    Michael avatar
    5 posts
    Member since:
    Jan 2012

    Posted 06 Nov 2017 in reply to Stef Link to this post

    Hi Telerik

     

    Like Jaw I now have to print an expenses report with attached pdf invoices.

    In my code I´m working with reportbooks. I use them to render them as pdf, to show them in the ReportViewer or to send them directly to the printer. In my architecture it is not really meaningful to merge invoice pdfs after an pdf of the report is created...

     

    I really want the possibility to add some pdf files to the report book. Or at least the possibility to include them in a report just like I can add a picture with a PictureBox.

     

    What solutions do you have for me?

     

    Regards,

    Michael

  11. Katia
    Admin
    Katia avatar
    693 posts

    Posted 07 Nov 2017 Link to this post

    Hi Michael,

    Inserting a PDF document into a report is still not supported and it is not in our short-term plans to add this feature. To insert a PDF it would be necessary to use third party libraries for merging documents or merge the files programmatically. You can check Stef's post for more suggestions.


    Regards,
    Katia
    Progress Telerik
    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 Feedback Portal and vote to affect the priority of the items
  12. Johnathan
    Johnathan avatar
    24 posts
    Member since:
    Jul 2010

    Posted 11 Apr 2018 Link to this post

    For those looking for a possible solution, here is a code snippet using open source PDFSharp with Telerik Reporting. (You can also get the source code for free) In this code, I am loading a PDF from a file, creating my own Telerik report and attaching it by pages to that document, and then adding a footer document from a file. ReportProcessor & RenderingResult are Telerik classes, and PdfDocument and PdfReader are PDFSharp classes:

    protected void ExportToPDF(InstanceReportSource reportSource)
    {
        ReportProcessor reportProcessor = new ReportProcessor();
        RenderingResult result = reportProcessor.RenderReport("PDF", reportSource, null);
     
        long classID = Int64.Parse(Request["cl"]);
        PdfDocument reportHeader = (classID > 1) ?
            PdfReader.Open(Server.MapPath("~\\Reports\\ClassHeader.pdf"), PdfDocumentOpenMode.Import) :
            PdfReader.Open(Server.MapPath("~\\Reports\\UnclassHeader.pdf"), PdfDocumentOpenMode.Import);
        PdfDocument reportMain = PdfReader.Open(new MemoryStream(result.DocumentBytes), PdfDocumentOpenMode.Import);
        PdfDocument reportFooter = (classID > 1) ?
            PdfReader.Open(Server.MapPath("~\\Reports\\ClassFooter.pdf"), PdfDocumentOpenMode.Import) :
            PdfReader.Open(Server.MapPath("~\\Reports\\UnclassFooter.pdf"), PdfDocumentOpenMode.Import);
     
        // Originally tried creating a new PdfDocument and combining all three PDFs,
        // but I could not figure out how to transfer fields from the header page to the combined document.
        // To solve this, I attached the main and footer PDF to the first page.
        // If the footer also has fillable fields, this will be a problem.
        foreach (PdfPage p in reportMain.Pages)
        {
            reportHeader.AddPage(p);
        }
     
        foreach (PdfPage p in reportFooter.Pages)
        {
            reportHeader.AddPage(p);
        }
     
        Response.Clear();
        Response.ContentType = result.MimeType;
     
        using (var ms = new MemoryStream())
        {
            reportHeader.Save(ms, false);
            ms.WriteTo(Response.OutputStream);
        }
        Response.End();
    }
Back to Top