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

Export To PDF and Save On Server

14 Answers 463 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 22 Feb 2011, 07:43 PM
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?

14 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 23 Feb 2011, 11:45 AM
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!
0
Sudhindra Shetty
Top achievements
Rank 1
answered on 21 Jul 2011, 05:01 PM
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.
0
Phillip
Top achievements
Rank 1
answered on 02 Dec 2011, 11:06 PM
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. 
0
Daniel
Telerik team
answered on 07 Dec 2011, 10:23 AM
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
0
Phillip
Top achievements
Rank 1
answered on 07 Dec 2011, 03:50 PM
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..
0
Daniel
Telerik team
answered on 12 Dec 2011, 01:56 PM
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
0
Seth
Top achievements
Rank 1
answered on 12 Sep 2012, 07:08 PM
Is there any other way to stop the document from being shown to the user other than using the Response.Redirect method?
0
Daniel
Telerik team
answered on 14 Sep 2012, 02:48 PM
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.
0
Kelvin
Top achievements
Rank 1
answered on 28 Jan 2016, 02:11 AM

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.

0
Daniel
Telerik team
answered on 01 Feb 2016, 04:43 PM
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
0
mouhamad
Top achievements
Rank 1
answered on 07 Apr 2016, 08:51 PM

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

0
Daniel
Telerik team
answered on 08 Apr 2016, 08:50 AM
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.
0
mouhamad
Top achievements
Rank 1
answered on 08 Apr 2016, 12:28 PM

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.

0
Daniel
Telerik team
answered on 08 Apr 2016, 03:31 PM
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.
Tags
Grid
Asked by
Anthony
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sudhindra Shetty
Top achievements
Rank 1
Phillip
Top achievements
Rank 1
Seth
Top achievements
Rank 1
Kelvin
Top achievements
Rank 1
mouhamad
Top achievements
Rank 1
Share this question
or