Hello we are facing problem while exporting direct from RadGridView to Excel. After exporting data, three problems are there in excel sheet.
1. Phone numbers are getting chopped off [Like "8.70772E+11" instead of "870772001799"]
[Instead of In DataTable PHONENUMBER is in String type]
2. Phone numbers are displaying as Right Align [Instead data type is String]
[Images given "Image .XLS file after exported .png"]
3. Group name is not showing in Excel sheet [Only first group is not showing]
Please advice.
Screenshot are given & the used code given bellow.
private void Button_export_Click(object sender, System.Windows.RoutedEventArgs e)
{
string extension = "xls";
string selectedItem = "Excel";
ExportFormat format = ExportFormat.Html;
SaveFileDialog dialog = new SaveFileDialog();
dialog.DefaultExt = extension;
dialog.Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", extension, selectedItem);
dialog.FilterIndex = 1;
if (dialog.ShowDialog() == true)
{
using (Stream stream = dialog.OpenFile())
{
GridViewExportOptions options = new GridViewExportOptions();
options.Format = format;
options.ShowColumnHeaders = true;
options.Encoding = Encoding.UTF8;
radGridViewSearch.Export(stream, options);
}
}
MessageBox.Show("Successfully Exported");
}
Thanks