This is a migrated thread and some comments may be shown as answers.

Data Export after filters are applied

7 Answers 537 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Hattan Shobokshi
Top achievements
Rank 1
Hattan Shobokshi asked on 17 Feb 2012, 05:26 PM
I have a kendo grid that is attached to a datasource. Users are able to apply filters on the grid and I'm wondering if there is a way to extract the data after the filters are applied?

The reason for this is that I can then send the filtered data to the server and export to csv/excel. Currently my export works, but doesn't take into account any filters. It exports all the data from the grid.

Thanks!

7 Answers, 1 is accepted

Sort by
0
Hattan Shobokshi
Top achievements
Rank 1
answered on 17 Feb 2012, 05:32 PM
I figured it out. I have to call the view function on the data source. That gives me back a javascript object with the filtered data.

var data = grid.data("kendoGrid").dataSource.view();

Thanks!
0
Roberto
Top achievements
Rank 1
answered on 13 Apr 2012, 10:11 AM
Hi Hattan,
i've your same problem.
Could you help me?
0
Hattan
Top achievements
Rank 1
answered on 13 Apr 2012, 05:12 PM
Hi Roberto,
Sure, have you tried calling the view function on the grids data source? That should return the data that is currently viewable in the grid.
0
Jonathan
Top achievements
Rank 1
answered on 16 Jun 2012, 03:11 PM
You care to share your code on how your exporting the data grid to excel/csv? I would love to see how you are doing it.
0
Vijay
Top achievements
Rank 1
answered on 27 Jun 2012, 07:08 AM
I have data in kendo grid and want export that to excell can you help me by code
0
Sang
Top achievements
Rank 1
answered on 12 Jul 2012, 04:47 PM
Hi Hattan,
If you don't mind, can you share your export code?  We're looking to do the same thing.  Thanks.
0
Hattan Shobokshi
Top achievements
Rank 1
answered on 12 Jul 2012, 05:04 PM
No problem. I'm currently extracting the data and sending it to an ASP.NET MVC action method that renders an excel file based on the data. The server side component is based on asp.net and uses a custom library that I built. 

I'm planning to put together a blog post to explain how I did. As soon as that's done I'll come back here and post an update.

Sorry for the delay guys, I've been super busy but I hope to have this up shortly.
Tags
Data Source
Asked by
Hattan Shobokshi
Top achievements
Rank 1
Answers by
Hattan Shobokshi
Top achievements
Rank 1
Roberto
Top achievements
Rank 1
Hattan
Top achievements
Rank 1
Jonathan
Top achievements
Rank 1
Vijay
Top achievements
Rank 1
Sang
Top achievements
Rank 1
Share this question
or