Formatting asp generated spreadsheet

D

+ DiamondEagle

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.
 
M

Manohar Kamath [MVP]

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.
 

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,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top