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.

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

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.

Article ID: Published Date: Last Revised Date: Platform: Control:
4335 04/14/2015 08/06/2015 JavaScript ejGrid
Did you find this information helpful?
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
Add Comment
You must log in to leave a comment

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.