ASP to EXCEL

D

DNKMCA

Hi,

Im creating an Excel file using ASP
Versions : Office 97

The formattting is not working properly in Excel 97, but the same works fine
in Office XP & 2000
Is there any additional code has to be added in my code to get a formatted
output in Excel 97 version?

Please help.

Thanks.


MyCode
---------

set Cn=server.createobject("ADODB.connection")
Cn.open sqlconstring
tfName = "salesexcel.xls"

set Rs=server.createobject("ADODB.recordset")
sql = "select * from sales WHERE month(saledate)=8 and day(saledate)=28
year(saledate)=2005"
Rs.open sql,Cn,1,3

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=" & tfName

if not rs.eof then
Response.write "<table>"
Response.write "<tr><td colspan='2'>ID</td><td
colspan='2'>Executive</td><td colspan='2'>Sales Done</td></tr>"
while not rs.eof
Response.write "<tr>"
Response.write "<td colspan='2'>" & rs(0) & </td>"
Response.write "<td colspan='2'>" & rs(1) & </td>"
Response.write "<td colspan='2'>" & rs(2) & </td></tr>"
rs.movenext
wend
enf if

Response.write "</table>"
set Cn = Nothing
-------------------------------------------------------------
 
B

Bob Barrows [MVP]

DNKMCA said:
Hi,

Im creating an Excel file using ASP
Versions : Office 97

I don't know the answer to your question, but please don't multipost.
Posting it here as
well as .asp.db did not increase your chances of getting an answer (most of
us
subscribe to both groups). On the contrary, if somebody had taken his time
to answer it here, only to find that it was already resolved in the other
group, that person may have been annoyed enough to ignore any future posts
from you, thereby decreasing your chances of getting help in the future.

There are times when you will not be sure which group is most appropriate,
and you will want to post a question to both groups. In that situation, you
should use the cross-posting technique, rather than posting the same message
multiple times. To crosspost, put a semicolon-delimited* list of the
newsgroups to which you wish to post in the To: header of your post and post
it once. It, and any replies to it, will appear in all the newsgroups in
your list. So, if I reply in .asp.db, my reply will also appear here in
..asp.general.

* ... or whatever delimiter is recognized by your news client
 

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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top