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

RadGrid export to Excel and set Excel autofilter

7 Answers 241 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Celeste
Top achievements
Rank 1
Celeste asked on 15 Nov 2010, 10:16 PM
Dear Forum,

Is there any way to set the autofilter property in Excel when exporting a table from RadGrid?

Thank you,
Celeste

7 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 Nov 2010, 10:34 PM
Hello Celeste,

Can you please post some more information about the functionality you would like to implement? This way I will be able to provide more to-the-point suggestion.

Regards,
Daniel
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
Celeste
Top achievements
Rank 1
answered on 16 Nov 2010, 02:27 PM
Daniel,

In Excel, open a workbook and then from the menu select Data => Filter => AutoFilter. That is the Excel AutoFilter feature. I would like to have that Excel feature enabled on the workshett that is exported from RadGrid to Excel.

Celeste
0
Daniel
Telerik team
answered on 16 Nov 2010, 02:34 PM
Hello Celeste,

This functionality is enabled out-of-the-box when using the ExcelML format.
Export to ExcelML demo

Let me know whether this helps.

Best regards,
Daniel
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
Celeste
Top achievements
Rank 1
answered on 16 Nov 2010, 02:49 PM
Daniel,

I'm using HTML format.

Celeste
0
Celeste
Top achievements
Rank 1
answered on 16 Nov 2010, 03:27 PM
Daniel,

I've changed the format for the export to ExcelML and I no longer get any data:

Also, I got this error from the code example:

Error 24 'Telerik.Web.UI.GridExcelBuilder.WorksheetOptionsElement' does not contain a definition for 'ActivePane' and no extension method 'ActivePane' accepting a first argument of type 'Telerik.Web.UI.GridExcelBuilder.WorksheetOptionsElement' could be found (are you missing a using directive or an assembly reference?) 

I've added both the assembly references in the example
using Telerik.Web.UI.GridExcelBuilder;
using System.Web.UI.WebControls;

So thie ExcelML format is really not working for me at all...
Celeste
0
Accepted
Daniel
Telerik team
answered on 16 Nov 2010, 03:57 PM
Hello Celeste,

Judging by the provided information, I suppose that you are trying to use new features (ActivePane property) with an older version of RadControls for ASP.NET AJAX. Please download the up-to-date version and try again.

As to the HTML format - I'm afraid we do not support AutoFilter when exporting in this format.

Regards,
Daniel
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
SUNIL
Top achievements
Rank 2
Iron
answered on 29 Jan 2011, 06:54 AM
Hi Celeste,

To automatically make filters appear in header row when exporting data as html, you need to follow the guidelines below. This works in Excel 2003 and Excel 2010 as I have tested in both.
  • You need to include some standard Excel schemas in your < html> tag. You can simply copy and paste the html tag in listing below.
  • You need to include an attribute that says x:autofilter = 'all' for each column header td tag. Don't do this for column value td tags.
For an example, you can see the listing below that can be saved as a '.xls' file.
Thanks
Sunil

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
 
<head></head>
 
<body >
 
<table >
  
 <tr >
  <td  width=130 x:autofilter='all'  
  >Age</td>
  <td  width=130 x:autofilter='all'
  >Salary</td>
 </tr>
 <tr height=18 style='height:13.2pt'>
  <td  >34</td>
  <td >2333</td>
 </tr>
 <tr >
  <td>55</td>
  <td>1222</td>
 </tr>
  
</table>
 
</body>
 
</html>
Tags
Grid
Asked by
Celeste
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Celeste
Top achievements
Rank 1
SUNIL
Top achievements
Rank 2
Iron
Share this question
or