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

Radgrid Export to Excel issue

2 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Em4o
Top achievements
Rank 2
Em4o asked on 06 Apr 2011, 01:02 PM
Hi,

So I had Radgrid on my page full with data, then I am using Export to Excel method from Radgrid to generate excel file.
Then I save that file TestExcel.xsl on my computer.

The problem is : After that I am trying to open that saved excel file using connection, with that below, then it fires for exception.

_objXConn.ConnectionString = String.Format( _

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""", _fullFilePath)

 

Exception:

 System.Data.OleDb.OleDbException: External table is not in the expected format.

There is no issue with the code when i try to open some other excel files with that connection.
Why is this happening? Can you help me?

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 11 Apr 2011, 03:39 PM
Hello Em4o,

It is not possible to import text-based Excel files (both ExcelML and HTML formats are text-based) using this approach. This would work with binary (BIFF) format which is not supported by RadGrid.

It is possible however to export RadGrid to CSV format and then import this file as explained below:
http://www.codeproject.com/KB/cs/UsingJetForImport.aspx

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
Em4o
Top achievements
Rank 2
answered on 09 May 2011, 08:18 AM
Thanks
Tags
Grid
Asked by
Em4o
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Em4o
Top achievements
Rank 2
Share this question
or