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

ExportToExcel worksheet name

4 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rene de Vries
Top achievements
Rank 1
Rene de Vries asked on 17 Jun 2009, 02:01 PM
Simple question  :)

Is it possible to assign a name to the Excel file worksheet created via RadGrid.MasterTableView.ExportToExcel() ?  I've noticed that the sheet automatically gets the same name as the given filename, but I would like to be able to change that.


4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 17 Jun 2009, 03:07 PM
Hello Rene,

It depends on the Export engine you use. It is possible to change the worksheet name for ExcelML only. Microsoft Excel automatically sets the worksheet name (equal to the file name) when using the HTML format.

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
Daniel
Telerik team
answered on 09 Jul 2009, 06:38 AM
Hello all,

I was asked about how to change the name of the worksheet when exporting to ExcelML.
protected void RadGrid1_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e) 
    ... 
    e.Worksheet.Name = "my worksheet"

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
Srujan
Top achievements
Rank 1
answered on 19 Sep 2013, 03:22 PM
Hi Daniel ,

When I try to include RadGrid1_ExcelMLExportRowCreated() event sheet name changes but no data is exported to excel .Below is the code I am using ,can you please suggest how to proceed further .

 

RadGrd1.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
RadGrd1.PageSize = RadGrd1.MasterTableView.VirtualItemCount;
RadGrd1.ExportSettings.IgnorePaging = true;
RadGrd1.ExportSettings.OpenInNewWindow = true;
RadGrd1.ExportSettings.ExportOnlyData = true;
RadGrd1.ExportSettings.FileName = "FileName";
RadGrd1.MasterTableView.ExportToExcel();

Thanks

0
Daniel
Telerik team
answered on 24 Sep 2013, 07:54 AM
Hi Srujan,

Try setting the UseAllDataFields to true as shown below:
<MasterTableView UseAllDataFields="true" .....>
       ....
</MasterTableView>

Regards,
Daniel
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Rene de Vries
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Srujan
Top achievements
Rank 1
Share this question
or