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

Export to excel file

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jun Ting
Top achievements
Rank 1
Jun Ting asked on 30 Apr 2010, 12:28 PM
Below is the problems when export the data from grid to excel file:
1. Number appear in scientific format
2. If the data contain the "<br/>", it will show in few rows. How to make it show in the same row?


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 30 Apr 2010, 09:59 PM
Hello Jun Ting,

1) You should set the number format on ExcelExportCellFormatting event manually:
Word/Excel export (HTML-based)

Sample code:
protected void RadGrid1_ExcelExportCellFormatting(object source, ExcelExportCellFormattingEventArgs e)
{
   if(e.FormattedColumn.UniqueName == "myColumn")
   {
      e.Cell.Style["mso-number-format"] = @"0000 0000 0000"; break; //sample
   }
}

2) Please examine the following thread: Export to Excel Issues

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Jun Ting
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or