currency formatting not showing in excel



I am getting a minor problem when exporting data from grid to Excell.
I have applied currency formatting on grid to a specific column, but when I export it to Excel, currency formatting is simply not there.

if grid shows $30.00, then excel is showing 30.

code I used for it is


Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();

SaveFileDialog saveFileDialog = new SaveFileDialog();
saveFileDialog.Filter = "Files(*.xls)|*.xls";
saveFileDialog.DefaultExt = ".xls";

if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
try
{

gecc.GridToExcel(this.grdSpreadsheetANReport.Model, saveFileDialog.FileName,
Syncfusion.GridExcelConverter.ConverterOptions.Visible);
if (MessageBox.Show("Do you wish to open the xls file now?", "Export to Excel", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
System.Diagnostics.Process.Start(saveFileDialog.FileName);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);

}

}

return true;
}
catch (Exception objException)
{
throw objException;
}
}

any help .............
advace thanks

regards,
Touqeer.

2 Replies

HA haneefm Syncfusion Team April 3, 2007 06:21 PM UTC

Hi Touqeer,

You would have to derive the GridExcelConverterControl class and implement the GridToExcel method. Please refer to the attached sample for more details and let me know if this helps.

Sample : GDBGCurrencyFormat.zip

Best regards,
Haneef


TA Touqeer Ahmed Ahson April 4, 2007 01:32 PM UTC

Hi Haneef
it is working thanks a lot...:)

Best Regards,
Touqeer.

Loader.
Up arrow icon