关于asp输出excel表格的问题
为什么报表会出现格式不正确?某些记录的字段换行
形如:
用户名 密码 作者
aa 123 54
aa 123
54
<%
dim fs, filename, strLine, myfile, link
Set fs = server.CreateObject("scripting.filesystemobject")
filename = gc_UploadTempPath_L & "\" & session("UserID") & ".xls"
if fs.FileExists(filename) then
fs.DeleteFile(filename)
end if
set myfile = fs.CreateTextFile(filename,true)
''strLine=""
strLine= "序号" & chr(9) & "图片标题" & chr(9) & "摄影师" & chr(9) & "首次下载时间" & chr(9) & "IP地址" & chr(9) & "下载用户"
myfile.writeline strLine
dim iMyCount
for iMyCount = 1 to nRecCount
dim myLine
myLine = rsDownloadLog("PicText")
''myLine=replace(myLine,chr(9), "")
strLine= iMyCount & chr(9) & myLine & chr(9) & rsDownloadLog("Author") & chr(9) & FormatDateTimeStr_excel(rsDownloadLog("dtDownload"), false, false) & chr(9) & rsDownloadLog("ip") & chr(9) & rsDownloadLog("UserID")
myfile.writeline strLine
rsDownloadLog.MoveNext
next
set fs=nothing
link="<A HREF=" & gc_UploadTempPath & session("UserID") & ".xls" & ">打开报表"
Response.write link
%>