Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to Stop Long Numeric to Scientific Conversion if Transfering data from DataGrid to Excel.

Reply
Thread Tools

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

 
 
RSB
Guest
Posts: n/a
 
      11-10-2004
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();
}


 
Reply With Quote
 
 
 
 
David Jessee
Guest
Posts: n/a
 
      11-11-2004
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
"RSB" <(E-Mail Removed)> wrote in message
news:ySwkd.2759$(E-Mail Removed)...
> 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();
> }
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having compilation error: no match for call to (const __gnu_cxx::hash<long long int>) (const long long int&) veryhotsausage C++ 1 07-04-2008 05:41 PM
int to numeric numeric(18,2) ? jobs ASP .Net 2 07-22-2007 12:32 AM
Arithmetic overflow error converting numeric to data type numeric. darrel ASP .Net 4 07-19-2007 09:57 PM
Using Numeric 24.0b2 with Scientific.IO.NetCDF bandw Python 5 07-06-2005 11:04 PM
check if string contains numeric, and check string length of numeric value ief@specialfruit.be C++ 5 06-30-2005 01:08 PM



Advertisments