473,796 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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 000012190000000 0
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.Charse t = "";
response.Conten tType = "applicatio n/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.RenderContro l(htmlWrite);
response.Write( stringWrite.ToS tring());
response.End();
}
Nov 18 '05 #1
1 1474
Well, its not converting....i ts 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" <rs*****@hotmai l.com> wrote in message
news:yS******** ********@news.c pqcorp.net...
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 000012190000000 0
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.Charse t = "";
response.Conten tType = "applicatio n/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.RenderContro l(htmlWrite);
response.Write( stringWrite.ToS tring());
response.End();
}

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2370
by: bandw | last post by:
I am having a problem using Numeric-24.0b2 in conjunction with the NetCDF module from ScientificPython (version 2.4.9). This problem does not surface using Numeric-23.8. The problem arises in using the "min" function on a NetCDF floating array. In 23.8, the "min" function returns a floating scalar, while in 24.0b2 it returns an *array* of length "1". Below I list a simple NetCDF file and a Python script that illustrate the problem. When I...
3
4535
by: Don.Vonderburg | last post by:
I am having a problem importing an Excel spreadsheet. I have a column in an Excel sheet with alphanumeric text and some of the cells are numeric. Some of the cells contain numbers like 12345.6 and when DTS is done importing it into a field that is nvarchar the results are "12345.600000000001". I have tried: 1. Changing the format of the Excel column to text 2. Using the formula =text(a1,0) which only truncates the .6 3. Using the...
1
1575
by: jelle | last post by:
#No rant intended I'm not at all confused wether I should learn an one of the advanced array modules, I'm slightly confused over which I should pick up. I'm impressed with the efforts of SciPy and Scientific, but since I'm fairly new to programming & OO, choosing Numarray over Numeric hasnt been that satisfactory at all, which is not a problem of the quality of Numarray, but the fact that a lot of modules still heavily realy on Numeric....
1
2325
by: NancyA | last post by:
I am using the following code to write data from a datagrid to an Excel file: Dim tw As New System.IO.StringWriter Dim hw As New System.Web.UI.HtmlTextWriter(tw) dg.RenderControl(hw) Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Response.AppendHeader("content-disposition", "attachment;filename=test.xls") Response.Write(txtWriter.ToString) Response.End()
3
1809
by: nkunkov | last post by:
Hi, I have read a lot of articles in this newsgroup about how to solve this problem but found no solution. I'm trying to export a C# datagrid to Excel file. Here is my code that I have also found on google: MyDataGrid.EnableViewState = false; MyPage.Response.Clear(); MyPage.Response.Buffer = true; MyPage.Response.AddHeader( "Content-disposition",
9
17710
by: Rui Sampainho | last post by:
Hi Is there any command to transfer the contents of a datatable to an array. What I'm looking for is sort of a bulk process, not an iteration with a loop based on a field by field or row by row process. Regards RMS
0
2121
by: ronysk | last post by:
Hi, I am posting here to seek for help on type conversion between Python (Numeric Python) and C. Attachment A is a math function written in C, which is called by a Python program. I had studied SWIG and Python/C API a bit. I was able to pass numeric array (Numeric Python) into the C function and access/change these arrays. Problem I am having is that I couldn't quite get the array converted back to some PyObject or something that...
0
3225
by: naorem ranjan | last post by:
I have one problem regarding format of mixed data columns in excel. I am using ADO.NET to retrieve data from excel sheet. Connection String used is: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\ITEM.xls;Extended Properties=\"Excel 8.0;HDR=YES;IMEX=1\" I am able to retrieve all data (numeric and text), but for cells which contains numeric (with greater than 8 digits) I am getting wrong values. Excel sheet ado.net...
1
3514
by: malick | last post by:
Hello it developers, I'm using PHPExcelReader which I downloaded from sourceforge (http://sourceforge.net/projects/phpexcelreader) To read excel xls files in php. In the file reader.php ( http://scripts.ringsworld.com/database-tools/xls2mysql/inc/Excel/reader.php.html ) Somewhere there happens a exponent to float conversion so that strings as 1E3 2E9 are converted to their floating point values. I'm trying to put this functionality off...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9525
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10452
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10221
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10169
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4115
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.