We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Exporting the grid to PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

129419 Mar 16,2017 11:43 AM UTC Mar 21,2017 03:50 AM UTC ASP.NET MVC 5
loading
Tags: Grid
Cornel Amarandei
Asked On March 16, 2017 11:43 AM UTC

Hi,

I want to export a grid to PDF. I was looking to the sample from https://help.syncfusion.com/aspnetmvc/grid/exporting?cs-save-lang=1&cs-lang=razor but I didn't find the implementation of the method DeserializeToModel().

Thanks,
Cornel.



Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On March 17, 2017 12:01 PM UTC

Hi Cornel,  
 
Thanks for contacting Syncfusion Support. DeserializeToModel is the method exist in the Utils class of the Syncfusion Libraries which will be available from the Syncfusion.EJ assemblies.  To use this method, you have chain its root class and namespace as follows.  
 
 
GridProperties obj = (GridProperties)Syncfusion.JavaScript.Utils.DeserializeToModel(typeof(GridProperties), GridModel); 
 
 
This has been used to deserialize the Grid Model (in string) to the GridProperties. We have also refreshed the online Help Document with this changes.  
 
 
We have also showcased the Exporting Demo in the following page which will programmatically deserialize the Grid model to GridProperties.  
 
 
We have also prepared  a sample that can be downloaded from the following location.  
 
 
Regards,  
Seeni Sakthi Kumar S. 


Cornel Amarandei
Replied On March 17, 2017 01:28 PM UTC

Hi Seeni,

Thanks for your information.

Now it's working. But I have two more questions:

1. how can I change the orientation for the PDF to landscape?
2. I have a button that do the export like this:
   function onPDFExport(args) {
        var gridObj = $("#TurnoverGrid").ejGrid("instance");  
        gridObj.export("Turnover/ExportToPdf");        
    }
How can I transmit to the method ExportToPdf() a second parameter, beside the GridModel? I need to transmit also a date, based on what I filter the data of the grid.

Regards,
Cornel.

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On March 20, 2017 02:14 PM UTC

Hi Cornel, 


Query #1:- how can I change the orientation for the PDF to landscape? 
 
We have already discussed about how to set the orientation for the PDF document in our Syncfusion Knowledge base. For your convenience please find the KB in following link. 
 
 
 
 
Query #2 :- How can I transmit to the method ExportToPdf() a second parameter, beside the GridModel? I need to transmit also a date, based on what I filter the data of the grid 
 
 
For this query also, we have already discussed  about how to pass additional parameter to server while exporting. Please follow the below kb link. 
 
 
 
 
Regards, 
 
Farveensulthana T 


Cornel Amarandei
Replied On March 20, 2017 02:57 PM UTC

Hi Farveensulthana,

Thanks for your information. It worked.

Regards,
Cornel.

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On March 21, 2017 03:50 AM UTC

Hi Cornel,  
 
Thanks for the update.  
 
We are happy to hear that your requirement has been achieved. Please get back to us, if you require further assistance on this.  
 
Regards,  
Seeni Sakthi Kumar S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;