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

[Solved] export to excel with extension .xlsx

3 Answers 264 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krishna
Top achievements
Rank 1
Krishna asked on 10 Apr 2009, 05:32 PM
Hi Team,
I am using the version 2008.3.1125.35
this is the code i use to export 
                grid.Rebind();
                grid.ExportSettings.IgnorePaging = true;
                grid.ExportSettings.FileName = "Name";
                grid.ExportSettings.ExportOnlyData = true;
                grid.MasterTableView.ExportToExcel();
it exports the data in .xls format by default... i have excel 2007 installed in my machine
it also gives the warning messages as below

The file you are trying to open, <pagename>.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

is there anything i can ovoid the format realted warning message? and also .xlsx file is very lighter than the .xls so we want to use the lighter version.

or is there any simple c# code i can write each row to excel file for telerik grid.

Thanks
-krishna

3 Answers, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 2
answered on 10 Apr 2009, 07:56 PM
Interesting version you have :-)

Go, read this blog:
The file you are trying...
0
Krishna
Top achievements
Rank 1
answered on 10 Apr 2009, 08:01 PM
sorry..that was some typo
corrected now
0
Saranya
Top achievements
Rank 2
answered on 29 Jul 2009, 05:02 AM
Hi,

I am also facing the same problem. What to do?

I am using radgrid v 4.5.

I am able to save xls file using ExportToExcel() method. Its opening fine in Excel 2000. But If I try to open in Excel 2007, it is saying a warning "Make sure it is from trusted source etc....". As suggested in this link http://www.telerik.com/help/aspnet/grid/grdexport.html I am giving Yes. But the data is not in proper format.. Some tagged format is coming. Can I know how to overcome this problem?

Regards,
Saranya
Tags
Grid
Asked by
Krishna
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 2
Krishna
Top achievements
Rank 1
Saranya
Top achievements
Rank 2
Share this question
or