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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export grid data to Excel, Word and PDF formats on external action

Platform: JavaScript |
Control: ejGrid |
Published Date: April 14, 2015 |
Last Revised Date: August 6, 2015

The Grid data export can be done externally using the “export” public method of the Grid. The export method will take three parameter such as URL to the export method, Server event name which is used in web forms and a third Boolean parameter to enable multiple grid export.

In the below, we have explained how to use the export method out of the grid to export the grid data. We have exported the grid data on button click.

The Grid initialization will be as follows.

JS

 

MVC

 

ASPX

 

The client side click event of the button in which we have invoked export operation is as follows.

 

We have used the Web API controller to perform the export operation and we can also MVC controllers or ASP.Net web methods to perform export. The Web API controller used is as follows.

 

The output will be as follows.

Figure 1: Grid with external button to perform export data.

Figure 2: Exported Excel file.

ADD COMMENT
You must log in to leave a comment
Comments
Surentslkajd Surentslkajd
Jul 07, 2015
I want to export to excel with date formatting. col.Field("DateCreated").HeaderText(appstrings.Date).Width(0).AllowFiltering(false).Format("{0:MM/dd/yyyy hh:mm:ss tt z}").Add(); I am able to see date time in PDF but not in Excel(showing only date) . what kind of changes need to see date time and zone in excel? Reply
Andrew Wing
Feb 17, 2016
useless. Reply
Xavier Reyes
May 18, 2018

it's posible with PHP?

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

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