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

exportToExcel client side not functioning with column renderers

3 Answers 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roatin Marth
Top achievements
Rank 1
Roatin Marth asked on 15 Nov 2010, 10:18 PM
Greetings folks,
I'm using the client side exportToExcel function like so: gridView().exportToCsv().
The csv that gets generated doesn't contain all of the expected data I see on the grid. 
The problem is I'm using column renderers on these fields to interpret numerical values and display them as text in english.
For some reason the exportToCsv only includes the underlying numerical data.

Is there anyway around this?
Or do I just have to bind the text data to the grid...

thanks

3 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 19 Nov 2010, 04:00 PM
Hi Roatin,

This is not a standard supported scenario. The exportToCsv() raises a postback event to perform exporting for the grid server side. That is why the client-side changes are not reflected in the exported format. So basically the exported data is what the grid is bound to.
You are right that one possible option is to directly bind the grid server-side and transform the data there. This way the export will pick up the correct data format. For more information on exporting in the CSV format you can check this help article.

All the best,
Marin
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Roatin Marth
Top achievements
Rank 1
answered on 17 Jan 2011, 05:34 PM
ah, fraid of that

there should be a means of just exporting what's being rendered on the grid, no?

thanks
0
Marin
Telerik team
answered on 18 Jan 2011, 11:44 AM
Hi Roatin,

I am afraid the grid does not support such scenarios because any modifications made to the client side HTML are not persisted on the server and the export logic is executed only on the server. The changes you have made client side first have to be persisted so the export functionality can detect them. Note that the client-side exportToCsv() function does not contain a logic for exporting, it only raises a postback and the actual processing is done on the server which does not know about the client-side changes.

All the best,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Roatin Marth
Top achievements
Rank 1
Answers by
Marin
Telerik team
Roatin Marth
Top achievements
Rank 1
Share this question
or