Hi,
I am using Response.BinaryWrite() to export a excel file. By default the whole numbers are display the same but i have to format cells by default of 2 decimalspoints.
I need a help to over come this issue and suggest me is there any telerik controls can be used.
I'm not sure where you are applying Export. In the case of Export in RadGrid, you can try the following code snippet to format a column text on Export.
ASPX:
<asp:ButtonID="Button1"runat="server"Text="Export To Excel"OnClick="Button1_Click"/>
Hi Princy,
Thanks for your quick reply. I am not using any radgrid Control to export. the data values are retrived from a file and forced to export using the following codes.
Dim fs As FileStream
fs = File.Open(strPath, FileMode.Open)
Dim bytBytes(fs.Length) As Byte
fs.Read(bytBytes, 0, fs.Length)
fs.Close()
Response.Buffer = False
Response.AddHeader("Content-Disposition", "attachment;filename=" & filename.Value)
' To open the csv file
Response.ContentType = "application/CSV"
Response.BinaryWrite(bytBytes)
Response.End()
By default the whole numbers are display the same but i have to format cells by default of 2 decimalspoints.
I need a help to over come this issue and suggest me is there any telerik controls can be used.