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

Export selected row in Grid to PDF

3 Answers 238 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joakim
Top achievements
Rank 2
Joakim asked on 12 Dec 2013, 12:14 PM
Hello,

I am using the "Export Grid to PDF" from the Code Library. 
http://www.kendoui.com/code-library/mvc/grid/export-grid-to-pdf.aspx

It works great, but I need to be able to choose which rows to export to PDF, with a checkbox, not the entire grid. 

I created this checkbox:
columns.Template(e => e.IsChecked).ClientTemplate("<input type='checkbox' #= IsChecked ? checked='checked':'' # value='#=EmployeeID#' />")
How can I access this in the controller, where the method to create the export is located?

Can someone point me in the right direction?



3 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 14 Dec 2013, 09:23 AM
Hello Joakim,

Basically you need to send the selected records to the server from then on the approach remains the same as in the code library.

Check the attached project, it should give you the idea.



Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mohamed
Top achievements
Rank 1
answered on 13 May 2014, 05:27 PM
Hi 
a have a probleme to export record in  pdf using itextsharp or any library to export pdf  there is my code :
i have two tables i am using Entity Framework :
public class personne{
 public int personneID { get; set; }
        public string Name  { get; set; }
        public string Designation  { get; set; }
public string workexperience  { get; set; }
 public string About  { get; set; }
Pulblic int LocationID

                 }
 
the second table :  
   public class Location{
 public int LocationID { get; set; }

        public string Location  { get; set; }
                          } i need to export pdf from all of two tables,not all of recods but with my choise or delected row (like edit or delete)  like in this pictures thank you
0
Petur Subev
Telerik team
answered on 15 May 2014, 08:10 AM
Hello Joakim,

Exporting with a third party library tool workflow is always the same. You create button with a href pointing to an action method that based on the state of the Grid will send all the state descriptors to the server. On the server side inside that action method you can create a DataSourceRequest get just those records using ToDataSourceResult() extension method and then use your exporting tool to create the result.

All those approaches are used in our exporting examples, you can get the idea from there:

http://www.telerik.com/search?start=0&q=export&collection=telerik30&ResourceType=CodeLibrary&hgurl=aspnet-mvc&fid=64f4cded-ad5e-4056-b6a0-5b4708d16d2f

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Joakim
Top achievements
Rank 2
Answers by
Petur Subev
Telerik team
mohamed
Top achievements
Rank 1
Share this question
or