473,810 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formatting asp generated spreadsheet

I'm successfully using Response.Conten tType = "applicatio n/vnd.ms-excel"
to generate an Excel spreadsheet from an asp page and a SQL Server
database.

One of the columns contains data that is a long number (13 characters
eg. 1122334444566). The spreadsheet does not display the number
correctly because the column is formatted as 'General' so it displays
1.12233E+12.
To correct this in Excel I simply change the column type to number. How
do I get around this in asp.

I know I could use fso to create the spreadsheet on the server using a
template, but I prefer to do it on the client side so that I don't
accumulate a whole lot of xls files on the server.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
1 1410
That's the limitation of spoofing a spreadsheet -- letting Excel believe the
incoming stream is actually an XLS file, when it is actually an HTML table.
One way around this would be to stream a rich-XML, with schema, but then
only Excel 2002 and later will be able to read this.

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"+ DiamondEagle" <an**********@w ebmail.co.za> wrote in message
news:u7******** ******@TK2MSFTN GP11.phx.gbl...
I'm successfully using Response.Conten tType = "applicatio n/vnd.ms-excel"
to generate an Excel spreadsheet from an asp page and a SQL Server
database.

One of the columns contains data that is a long number (13 characters
eg. 1122334444566). The spreadsheet does not display the number
correctly because the column is formatted as 'General' so it displays
1.12233E+12.
To correct this in Excel I simply change the column type to number. How
do I get around this in asp.

I know I could use fso to create the spreadsheet on the server using a
template, but I prefer to do it on the client side so that I don't
accumulate a whole lot of xls files on the server.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2

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

Similar topics

0
1496
by: scooterm | last post by:
### Question Can anyone name a text editor or XML editor (prefer open source) that can open a simple table XML file in a spreadsheet-type GUI, without adding any extra formatting or junk to the XML file? For example, given the following very simple XML file: <table> <row> <fname>fred</fname>
1
2074
by: Josh Schmidt | last post by:
I'm using the Excel application object to create a spreadsheet from a recordset. Everything seems to work fine except any date fields are not displaying properly. For example 4/18/2004 is displaying as 38095 in the spreadsheet. I loop through the recordset to display each row. The line that actually writes out the field is: objSpreadsheet.Cells(iRow, iCol).Value = objField.Value
2
1950
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with formatting to another program. The help file reads: "Formula One maintains its own internal clipboard and also supports text on the Windows clipboard. The internal clipboard is more flexible than the Windows clipboard. The internal clipboard...
0
2945
by: ImraneA | last post by:
Hi there Have a database, where front-end interface allows user to select a ms access database. From there, standard tables are linked. Routine, that creates a spreadsheet, for each table a separate sheet within spreadsheet is created. Particular fields are selected. User requires fields to be auto-fitted. Problem, is that some tables have more than 1200> rows. Code generates error message. Is there a way of getting around this...
0
1733
by: Giganews | last post by:
I have a TransferSpreadsheet process in my Access 97 database that sends data out to an Excel spreadsheet formatted with a Times New Roman 10 point font, centered text, etc... This always works fine until data gets exported into a cell on the spreadsheet that never had data in it before. The data uses the default font (usually MS Sans Serif), is not centered, and will not wrap. When I originally formatted the spreadsheet I selected the...
0
1747
by: sradoff | last post by:
I wish to use XPath to access data from within an Excel generated XML Spreadsheet (generated with MS Excel 2003). I am using an asp Web page (not .NET, not at this time). I instantiate MSXML.DomDocument.3.0. After loading the Excel generated XML Spreadsheet parse error free, I issue the following XPath query to create a set of row nodes from within the document: "//Workbook/Worksheet/Table/Row" I am greeted with the following error: Reference to...
6
5229
by: DeniseY | last post by:
I have an Access report that is created on the fly by the user selecting the fields to be included. The Access report comes out fine, but I want it to automatically output to an Excel spreadsheet. Again, I have this part working. But the fields in the resulting spreadsheet are in a different order than the Access report. (Example: The fields in the Access report might go FirstName, LastName,Address,City--in the Excel spreadsheet, they come up...
3
7558
by: jmarcrum | last post by:
I want to export a report (that contains two separate queries, 1. Current year data, and 2. split-year data) from access into excel, but everytime I run my code and export the data to excel, it looks like garbage. I have maximize and minimize buttons on the left side of the excel spreadsheet that I don't want. I want separate tabs on the bottom of the spreadsheet that show the two queries separately from one another. But I don't know how...
2
1618
by: mattloflin | last post by:
First off I have searched on this forum and others for about 1.5 hours and can't find relevant information. I have a form that is in viewsheet or datasheet mode so when you click it it looks like a spreadsheet. this is the code that i want to expand but I have to get it working first. With Me.Description If .Value = "Print Not Available" Then .ForeColor = vbRed End If
0
9722
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
9603
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
10644
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...
1
10393
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,...
0
10124
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
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
3863
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.