Hi,
I don't know if this is the correct forum for this question but I couldn't find an Excel export/import forum which might be more suitable.
I'm using GridViewSpreadStreamExport to export RadGridViews to Excel which works fine and I can open the generated spreadsheet in Excel without any issues.
The issue comes when I try to open/read the generated spreadsheet in code using OleDbCommand with the following connection string:
@"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + path + "; Extended Properties = " + @"""Excel 12.0 Xml;HDR=YES;IMEX=1"";";
I get an "External table is not in the expected format" error message on opening the connection.
If I first open the generated spreadsheet in Excel and just save it, without making any changes to it,the issue does not occur and I can open the spreadsheet in code without any issues.
The spreadsheet does have multiple worksheets, each one from a new instance of a RadGridView, but I don't think that is the issue because generating a spreadsheet with a single worksheet has the same issue.
The RadGridView is in memory, not on the UI, and I just set some of the column headers, width and text alignments.
Export format is SpreadStreamExportFormat.Xlsx and the export of individual RadGridViews are done via:
spreadStreamExport.RunExport(path, new SpreadStreamExportRenderer());
Although I have tried not creating a new instance of SpreadStreamExportRenderer as well.
I've reduced the export to its bare minimum (removed column header and text alignment settings) but nothing has helped.
Any ideas what the issue could be?
Thanks,
Arash