I've been working with Telerik RadGrid, MasterTableView an I tried to
export my data to Excel but with no success. The file is created and
saved on my workstation but the file is not of "Excel" kind.
When I open the file it only contains HTML. Is this right? Excel says that the file is not of any correct Excel type!
Update: This error only occurs when you use "Excel Viewer" due to the fact that "Excel Viewer" can't convert the outputed HTML file to a "real" Excel formated document.
Is there anyway to get the output as a real Excel document not a invalid document in HTML?
When I open the file it only contains HTML. Is this right? Excel says that the file is not of any correct Excel type!
Update: This error only occurs when you use "Excel Viewer" due to the fact that "Excel Viewer" can't convert the outputed HTML file to a "real" Excel formated document.
Is there anyway to get the output as a real Excel document not a invalid document in HTML?
6 Answers, 1 is accepted
0
Hello Erik,
As you can see in our documentation, only MS Word and MS Excel 2003 or later are supported. This doesn't include Microsoft Excel Viewer 2003 and Microsoft Excel Viewer.
RadGrid exports two Excel formats:
- HTML based
- XML based (ExcelML / XML spreadsheet)
Regarding the file format error I recommend you examine the following link:
"The file you are trying to open, '[filename]', is in a different format" Excel Error
Let us know if you need more information.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
As you can see in our documentation, only MS Word and MS Excel 2003 or later are supported. This doesn't include Microsoft Excel Viewer 2003 and Microsoft Excel Viewer.
RadGrid exports two Excel formats:
- HTML based
- XML based (ExcelML / XML spreadsheet)
Regarding the file format error I recommend you examine the following link:
"The file you are trying to open, '[filename]', is in a different format" Excel Error
Let us know if you need more information.
Best regards,
Daniel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0

Town
Top achievements
Rank 1
answered on 09 Jul 2010, 03:20 PM
Hi there,
I've come up against the same problem (using Excel 2007 to open an XLS), and I don't think the answer above really answers Erik's original question: "Is there anyway to get the output as a real Excel document not a invalid document in HTML?"
I'm guessing the answer is "no", it just seems strange to have an ExportToExcel() method that is actually ExportToHTML()... Can you confirm that HTML is the only possible format to get from this method? It's not ideal as our users will see the warning message every time they open the exported XLS.
Thanks,
Chris
Edit: I should add that we're using RadGrid 4.6.1, so exporting to CSV isn't an option.
I've come up against the same problem (using Excel 2007 to open an XLS), and I don't think the answer above really answers Erik's original question: "Is there anyway to get the output as a real Excel document not a invalid document in HTML?"
I'm guessing the answer is "no", it just seems strange to have an ExportToExcel() method that is actually ExportToHTML()... Can you confirm that HTML is the only possible format to get from this method? It's not ideal as our users will see the warning message every time they open the exported XLS.
Thanks,
Chris
Edit: I should add that we're using RadGrid 4.6.1, so exporting to CSV isn't an option.
0
Chris,
Please note that Microsoft Office HTML and XML is not our proprietary format. Even though it is not a binary Excel format (BIFF) it is a still a valid Microsoft Office file format.
If you are not satisfied with the provided export options you can use third-party libraries like NPOI.
Regards,
Daniel
the Telerik team
Please note that Microsoft Office HTML and XML is not our proprietary format. Even though it is not a binary Excel format (BIFF) it is a still a valid Microsoft Office file format.
If you are not satisfied with the provided export options you can use third-party libraries like NPOI.
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
0

siva
Top achievements
Rank 1
answered on 19 Jan 2011, 08:01 AM
Hi,
how to achive number format with this code r html code to exportexcel data with number format.
i need exportdeecxel with number format.
"the datasource which i has that contain the numberformat. but not the same in exportdeexcel" plz help
RadGrid1.PageSize = RadGrid1.MasterTableView.VirtualItemCount;
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
RadGrid1.MasterTableView.ExportToExcel();
how to achive number format with this code r html code to exportexcel data with number format.
i need exportdeecxel with number format.
"the datasource which i has that contain the numberformat. but not the same in exportdeexcel" plz help
RadGrid1.PageSize = RadGrid1.MasterTableView.VirtualItemCount;
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
RadGrid1.MasterTableView.ExportToExcel();
0
Hello Siva,
You can apply the desired number format programmatically. I recommend that you examine our online demos:
MS Excel/MS Word/CSV
Export to ExcelML
or the documentation:
Word/Excel export (HTML-based)
ExcelML basics
Let me know if you need more information.
Best regards,
Daniel
the Telerik team
You can apply the desired number format programmatically. I recommend that you examine our online demos:
MS Excel/MS Word/CSV
Export to ExcelML
or the documentation:
Word/Excel export (HTML-based)
ExcelML basics
Let me know if you need more information.
Best regards,
Daniel
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.
0

Evan
Top achievements
Rank 1
answered on 19 Dec 2012, 05:08 AM
Daniel:
I used the bellow code to export excel .
There are only 218 records in RadGrid but it took 3 minutes. Could you tell me how to improve efficiency?
I used the bellow code to export excel .
There are only 218 records in RadGrid but it took 3 minutes. Could you tell me how to improve efficiency?
this.gridReports.MasterTableView.ExportToExcel();