I've got a RadGrid that contains multiple DataList in a template column, most all the values are numeric, but not all. I can export to excel, and most everything is correct, however in my situation, I need different formats for the cells, depending on the datalist.
This is my export secion
gv.ExportSettings.FileName = Format(Now(), "MMddyyyy") |
gv.ExportSettings.IgnorePaging = True |
gv.ExportSettings.ExportOnlyData = False |
gv.ExportSettings.OpenInNewWindow = True |
gv.ExportSettings.HideStructureColumns = True |
gv.MasterTableView.ExportToExcel() |
Example Output
From the sample, which is linked to above, I need a different format on the numeric values for SP, CFM, BHP and Sone, which I have working on the screen. The issue is when I export to excel trailing 0's on the decimal fields are chopped off. If it's whole number, the trailing 0's aren't chooped off. Per the link to the Example output,
SP cell c1 should be 0.000 cell K1 should be 1.000, always contain three decimals
BHP cell c6 should be 1.370, always contain three decimals
The Radgrid is a copy of the grid shown on the screen, I need slightly different formating when exported versus what's shown on the screen. I've wired up the ExcelExportCellFormatting event to gv
AddHandler gv.ExcelExportCellFormatting, AddressOf Me.gv_ExcelExportCellFormatting |
I can get the individual datalist in this event, but how do I apply a specific format to the Cells within the Datalist whenexported to Excel?
Hopefully I've provided enough info to get some assistance here, of not let me know and I'll try respond with additional info.
Thanks in Advance