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

Export to PDF- with a Rad Grid and asp.net grid using ItextSharp

4 Answers 95 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sanket
Top achievements
Rank 1
Sanket asked on 30 Apr 2013, 02:45 PM
I have an aspx page that contains an asp.net grid created from codebehing and rendered on pageload. This acts as the header for a RadGrid that contains the detail. Both the grids are in separate pannel.
I am using iTextSharp to export both the grids into a pdf. I am using the code below to create a form dynamically and then rerender it into a pdf:

HtmlForm

 

form = new HtmlForm();

 

form.Controls.Add(MyRadGrid1);

 

StringWriter sw = new StringWriter();

 

 

HtmlTextWriter hTextWriter = new HtmlTextWriter(sw);

 

form.Controls[0].RenderControl(hTextWriter);

I am getting several errors during the 'form.Controls[0].RenderControl(hTextWriter)' .
This code is unable to render all the telerik controls in the RadGrid.

Is there any other way that this could be achieved? Should i look into other options that will be better than itextSharp ?

Thanks in advance.

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 May 2013, 08:05 AM
Hi Sanket,

You can make avail of the in-built PDF export functionality of RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/pdfexport/defaultcs.aspx

Or check out the provided example in the last post of the following thread:
http://www.telerik.com/community/forums/aspnet-ajax/grid/print-whole-radgrid-from-clientside-during-print.aspx

Hope this helps.

All the best,
Eyup
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
Ogunseye
Top achievements
Rank 1
answered on 18 Dec 2013, 05:25 PM
The link given wld only export the gridview, but in my case, i have an asp:panel containing 3 diffferent radgrids and i want to export the entire panel to pdf using itextsharp.

Please it is urgent
0
Eyup
Telerik team
answered on 23 Dec 2013, 07:42 AM
Hello Ogunseye,

Please note that combining third-party controls with Telerik UI controls is beyond our support scope. I highly suggest that you check the following samples and determine which one meets your specific requirements:

I hope this will prove helpful.

Regards,
Eyup
Telerik
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 the blog feed now.
0
Garry
Top achievements
Rank 1
answered on 21 Apr 2019, 08:00 PM
I have some experience with Zetpdf.com as well. It's really convenient and easy to use
Tags
General Discussions
Asked by
Sanket
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Ogunseye
Top achievements
Rank 1
Garry
Top achievements
Rank 1
Share this question
or