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

[Solved] Server side export when using DomainDataSource

3 Answers 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Berthold
Top achievements
Rank 1
Berthold asked on 03 Oct 2010, 09:52 PM
Hi,
I need a xlsx-export (Excel 2007/2010). 
Unfortunately this is not provided by telerik-GridView. So I try to do this on server side. 
Additionally,  I'm working with paged data (around 5'000 rows - depends on current filter)

So what I do: 
- using DomainDataSource and bind this to GridView
- provide server side filtering and sorting (see blog "PureServersideFiltering")

Now I want export my filtered and sorted data.
An example:
- user X set a filter  (on client side): "name='White' and firstname='Peter'"
- the sort order is "name descending"
This is done by adding some FilterDescriptors and SortDescriptors to the DomainDataSource-object (and call DomainDataSource.Load())
Now the user wants to export EXACTLY the result set seen in GridView-control - but as xlsx.

Is there a way to get the DomainDataSource-filter and sort information in my domainService-class (server side)? 
Maybe this filter-information is accessible in the ObjectContext (until now, i didn't find a solution)?

Thanks for your help
Berthold



  

3 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 08 Oct 2010, 06:38 AM

Hello Berthold,

May I suggest an alternative option which could be very easy to implement? You could try exporting the grid data as tab delimited string and then pass this string to a web service method which will convert it to xlsx format. This will spare any efforts to transfer entity objects.



All the best,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Berthold
Top achievements
Rank 1
answered on 08 Oct 2010, 08:29 AM
Hi,

thanks for your hint.
I had the same idea, but I think it doesent work since I want to export a table the could have more the 10'000 (paged) rows.

Regards
Berthold
0
Milan
Telerik team
answered on 18 Oct 2010, 12:02 PM
Hello Berthold,

I am afraid that this is not possible to get the items as they appear on the grid.

I guess that the approach that I have mentioned is one of the few possible solutions. If you have large data array you could try to compress the exported tab-delimited data before sending it thought the wire. 

Best wishes,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Berthold
Top achievements
Rank 1
Answers by
Milan
Telerik team
Berthold
Top achievements
Rank 1
Share this question
or