Super Simple Spreadsheet Export from Kendo UI Grid

By February 4, 2014Uncategorized

I was recently working on a way to download data displayed in a Kendo UI grid into a file for opening in Excel. Nothing fancy, just a way to grab a file that would open as a spreadsheet and let the user view the data.  Preferably something that could be done all client-side, and applied to all of the (many) Kendo grids on the site.

Of course, I wasn’t the first person to need this – I found a great resource for converting the grid datasource into a .csv file, but what I also wanted was a easy way to download the file. A simple file download library helped out there, and then all it needed was a little trial and error to get everything to work correctly together. Starting from Josh’s JSFiddle starter template, I put together an example so you can try it yourself:

Just click the button to download the data to a file that opens in your favorite spreadsheet application:

image            image

If you want this to work on browsers that don’t already support the blob interface, you will also need a library to handle them.  More on that in another blog, but for now this is enough to get a super-simple spreadsheet download working for all of your standard grids.  Enjoy!

The following two tabs change content below.