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

Changing Worksheet name while exporting to CSV

3 Answers 586 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dhaval
Top achievements
Rank 1
Dhaval asked on 31 Jan 2012, 01:51 PM
Hi All,

I am facing a situation here where I need to change the worksheet name of CSV file. I use below code to export my grid to CSV.

grid1.MasterTableView.ExportToCSV();

I don't want to export file to excel (i.e. xls or Excelml). I am using Telerik 2011 Q3. Is it possible to do the same in Telerik 2012 Q1?

Thanks in advance!!!

Dhaval Tamhane



3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 31 Jan 2012, 01:59 PM
Hello,

Try setting the FileName as shown below.
C#:
radgrid1.ExportSettings.FileName = "Customer";

-Shinu.
0
Dhaval
Top achievements
Rank 1
answered on 31 Jan 2012, 02:03 PM
Hi Shinu,

Thanks for your reply, but sorry that I was not more clear.

Actually my worksheet name is different than filename. If I give your code, then filename will be assigned to worksheet, but I don't want that.

Dhaval Tamhane
0
Richard
Top achievements
Rank 1
answered on 31 Jan 2012, 10:13 PM
Dhaval:

As far as I know, it is not possible to change the sheet name out-of-the-box when using the CSV export format.

In order to do this you'd have to export to ExcelML and use the method specified in the How to set excel sheet name in Radgrid Export to excel function? forum thread.

Cheers!
Tags
Grid
Asked by
Dhaval
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dhaval
Top achievements
Rank 1
Richard
Top achievements
Rank 1
Share this question
or