To reproduce:
Try setting the value in the CellForamting event.
Workaround:
class MySpreadExportRenderer : SpreadExportRenderer
{
public override void SetCellSelectionValue(DataType dataType, object value)
{
base.SetCellSelectionValue(dataType, value);
if (dataType == DataType.Number)
{
CellRange range = ((CellSelection)this.GetCellSelection()).CellRanges.ElementAtOrDefault(0);
double d;
if (double.TryParse(Convert.ToString(value), out d))
{
var cell = ((Worksheet)this.GetWorksheet()).Cells[range.FromIndex.RowIndex, range.FromIndex.ColumnIndex];
cell.SetFormat(new CellValueFormat("#,##0.00"));
cell.SetValue(d);
}
}
}
}
In order to customize the number formatting of exported RadPivotGrid, you can subscribe to PivotGridSpredExport.CellFormatting event. The code below demonstrates how can you achieve it:
void spreadExport_CellFormatting(object sender, PivotGridSpreadExportCellFormattingEventArgs e)
{
if (e.ColumnIndex >= 3 && e.ColumnIndex >= 12)
{
e.Cell.FormatString = "#.000";
e.Cell.BackColor = Color.LightCyan;
}
}
Keep in mind, that MS Excel supports its own formatting strings. In the following article, you can find more details on formatting in MS Excel ( //http://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/format-codes )