467,169 Members | 940 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,169 developers. It's quick & easy.

Formatting asp generated spreadsheet

I'm successfully using Response.ContentType = "application/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
  • viewed: 1223
Share:
1 Reply
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**********@webmail.co.za> wrote in message
news:u7**************@TK2MSFTNGP11.phx.gbl...
I'm successfully using Response.ContentType = "application/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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Josh Schmidt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.