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