How to Stop Long Numeric to Scientific Conversion if Transfering data from DataGrid to Excel.

R

RSB

Hi Everyone,
i am using the following code to transfer a DataGrid to Excel File.
Every thing works ok beside the long numerice value like 0000121900000000
gets converted to 1.219E+11.
how can i disable that conversion?
Thanks for the Help

RSB



public static void DataGridToExcel(DataGrid dgExport, HttpResponse
response){
response.Clear();
response.Charset = "";
response.ContentType = "application/vnd.ms-excel";
StringWriter stringWrite = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DataGrid dg = new DataGrid();
dg = dgExport;
dg.AllowPaging = false;
dg.AllowSorting = false;
dg.GridLines = GridLines.Both;
dg.HeaderStyle.Font.Bold = true;
dg.DataBind();
dg.RenderControl(htmlWrite);
response.Write(stringWrite.ToString());
response.End();
}
 
D

David Jessee

Well, its not converting....its just a formatting issue. I don't know what
your class is doing as far as exporting the data, so I can't tell you
exactly how to do it. But approach it as a formatting issue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top