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

EXport RadGrid to Excel 2007

3 Answers 421 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 05 Apr 2011, 04:10 PM
I have seen plenty of forum thread but none of them, even the current ones, supply a resolution to exporting to Excel 2007 using the "XLSX" extension. 

I am using the Ajax Q1 release for 2011 and ASP.Net 4.0 assemblies.  What do I need to change here to export a grid to an xlsx file??

RadGrid1.MasterTableView.ExportToExcel()

I have tried added the following to the RadGrid export settings before call the export method but get a file format or extension is invalid exception:

RadGrid1.ExportSettings.Excel.FileExtension = "xlsx"

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Apr 2011, 09:29 AM
Hello Robert,

I have found one forum which is discussing about exporting to excel using the "XLSX" extension. Please take a look at this and see if it helps.
export to ecxcel is giving some message with aspx page

Thanks,
Princy.
0
Robert
Top achievements
Rank 1
answered on 07 Apr 2011, 03:25 PM
Hey Princy,

So basically the RadGrid method ExportToExcel2007 was deprecated and any way of exporting specifically to that extension is no longer available? 

What is the purpose of this property?

RadGrid1.ExportSettings.Excel.FileExtension

if I set it to:

RadGrid1.ExportSettings.Excel.FileExtension = "xlsx"
Office says the file format or file entension is not valid.

 


Thanks

Robert

0
Daniel
Telerik team
answered on 08 Apr 2011, 09:43 PM
Hello Robert,

Currently RadGrid supports two different Excel-compatible standards:

- Office HTML
Word/Excel export (HTML-based)

- ExcelML (XMLSS)
ExcelML basics

The content that is generated when using these formats could not be saved with xlsx extension.
If you need to use specifically this format you will have to use a third-party library like NPOI (it is free).
Export to Excel with third-party library (NPOI)

As to the ExportToExcel2007 method - it does almost the same as ExportToExcel, so we decided to merge both methods and to mark the ExportToExcel2007 method as deprecated. Note that it was part of our former ASP.NET suite - RadControls for ASP.NET (also known as "Classic").
This method is not available in RadControls for ASP.NET AJAX.

Best regards,
Daniel
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
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Robert
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or