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:
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!
Latest posts by Falafel Posts (see all)
- Matching Complex Query String Rewrite Rule in IIS - March 22, 2017
- Using Google Services in UWP C# Apps – Part 2 - February 7, 2017
- Using Google Services in UWP C# Apps – Part 1 - February 6, 2017
- Redis Caching in the Google Cloud Platform - February 3, 2017
- Entity Framework with Google Cloud SQL - February 2, 2017