Export To PDF and Save On Server

15 posts, 0 answers
  1. Anthony
    Anthony avatar
    6 posts
    Member since:
    Aug 2010

    Posted 22 Feb 2011 Link to this post

    Is it possible to use the export to pdf function of a radgrid to save the outputted pdf on the server? Essentially what I am trying to accomplish is to have a page with a bunch of user inputs and then when the user clicks the submit button it would save the page with everything that they have typed in as a pdf. I was hoping to achieve this by putting the entire page inside of a radgrids item template and then in the submit buttons code behind, I would like to export the grid to pdf and save it in a directory on the server. Is this at all possible? Is there an example somewhere on how to do it? Is this even the best approach to take?
  2. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 23 Feb 2011 Link to this post

    Hello Anthony,

    I created a runnable demo for you. Test it at your side and let me know if you need further assistance.

    Kind regards,
    Daniel
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sudhindra Shetty
    Sudhindra Shetty avatar
    4 posts
    Member since:
    May 2010

    Posted 21 Jul 2011 Link to this post

    Thanks for the server side implementation. It really helped me.

    Only question is how do we handle the file extensions. In this case you have hardcoded .pdf in  ResultsGridExporting function.

    What if we want to export to different types word,pdf,excel etc?

    Thanks.
  5. Phillip
    Phillip avatar
    27 posts
    Member since:
    Mar 2011

    Posted 02 Dec 2011 Link to this post

    Can this file be generated, forced to print, and then deleted?  So that a print button can be created on the radgrid that will pull up the print dialog directly without displaying the pdf. 
  6. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 07 Dec 2011 Link to this post

    Hi guys,

    @Sudhindra: Aside from the obvious differences in the method names, you have to use GridExporting when exporting to the rest of the supported formats.

    @Phillip: I'm afraid we do not provide such functionality. If you need to print the control, please refer to the following code-library:
    Print RadGrid contents

    Best regards,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  7. Phillip
    Phillip avatar
    27 posts
    Member since:
    Mar 2011

    Posted 07 Dec 2011 Link to this post

    I wish that would work, but that method leaves to much up to the user's interpretation of the web page.  If I can force pdf I can control margins, print size, etc..
  8. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 12 Dec 2011 Link to this post

    Phillip,

    You can try to embed the exported pdf file and then force the print dialog but this is out of the scope of our product.
    See the attached project.

    Thanks,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  9. Seth
    Seth avatar
    66 posts
    Member since:
    Oct 2009

    Posted 12 Sep 2012 Link to this post

    Is there any other way to stop the document from being shown to the user other than using the Response.Redirect method?
  10. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 14 Sep 2012 Link to this post

    Hello Seth,

    The PDF file is generated too late in the page lifecycle. The redirect is the only way to go in this case. Ending the response will result in a blank screen.

    Regards,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  11. Kelvin
    Kelvin avatar
    1 posts
    Member since:
    Jul 2012

    Posted 27 Jan in reply to Daniel Link to this post

    Hi Daniel,

    I have exactly the same requirement but not able to down your demo file.  Is it possible for you to email the file. Thank you.

  12. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 01 Feb Link to this post

    Hello Kelvin,

    There are two demos attached here. Which one do you need? The first one is about saving the file on the server and the second one is regarding printing the PDF file.

    Regards,
    Daniel
    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
  13. mouhamad
    mouhamad avatar
    4 posts
    Member since:
    Mar 2016

    Posted 07 Apr Link to this post

    Plz i need to help,

    i want to export records checked by checkbox in radgrid  with content arabic and dir="rtl" to pdf

    and i want to ask if i can using export with iTextSharp support rtl 

    thx for help

  14. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 08 Apr Link to this post

    Hello Mouhamad,

    RTL support couldn't be added to our PDF export due to major internal limitation.
    In theory, you could use any third party library but I would recommend that you first test the compatibility with our controls.
    Please excuse us for any inconvenience caused.

    Regards,
    Daniel
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  15. mouhamad
    mouhamad avatar
    4 posts
    Member since:
    Mar 2016

    Posted 08 Apr Link to this post

    Thx Daniel,

    plz find attached file , then i use <ExportSettings Pdf-DefaultFontFamily="Arabic Typesetting"  > the result in screenshot problem

    and another screenshot solution i needed.

  16. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 08 Apr Link to this post

    Hello Mouhamad,

    I understand that there are problems with right-to-left languages and as I mentioned in my previous reply, this is not a supported scenario.
    Unsupported features

    Regards,
    Daniel
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017