Nicholas Paldino,
Here is my code:
Dim x, OutputFilePath, outString, strDelimeter, atmp
strDelimeter = ReadText
OutputFilePath = Day(Date) & Month(Date) & Year(Date) & Hour(Time) &
Minute(Time) & Second(Time) & Int(Rnd*99) + 1
atmp = "<% codepage = 1200 " & strDelimeter
outString = atmp
outString = outString & "<% Response.Charset = ""UTF-8"" " &
strDelimeter & vbCrlf
outString = outString & "<% Response.ContentType =
""application/vnd.ms-excel"" " & vbCrlf
outString = outString & "Response.AddHeader ""Content-Disposition"",
""inline; " & ""
outString = outString & "filename=" & OutputFilePath & ".xls"" " &
vbCrlf
OutputFilePath = OutputFilePath & ".asp"
WriteTofile outString, OutputFilePath
WriteTofile strDelimeter, OutputFilePath
'Retrieving data from oracle process
Response.Write("<script language=""javascript"">")
Response.Write("window.open('Reports/" & OutputFilePath & "');")
Response.Write("</script>")
Public Function WriteToFile(Contents, FileName)
On Error Resume Next
Dim arrFile
arrFile = split(FileName, ".")
FileName = arrFile(0) & "." & arrFile(1)
FilePath = Server.MapPath(FileName)
If arrFile(1) = "htm" Then
Dim tempPath, objStream
tempPath = Mid(FilePath, 1, (Len(FilePath)-Len(FileName)))
FilePath = tempPath & "Reports\" & FileName
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FilePath, 8, True)
oTextFile.Write Contents
oTextFile.Writeline ""
oTextFile.Close
'ExcelFile FilePath, FileName
Else
Dim tmpPath, objFile2
tmpPath = Mid(FilePath, 1, (Len(FilePath)-Len(FileName)))
FilePath = tmpPath & "Logs\" & FileName
set oFs = server.createobject("Scripting.FileSystemObject")
set oTextFile = oFs.OpenTextFile(FilePath, 8, True)
oTextFile.Write Contents
oTextFile.Writeline ""
oTextFile.Close
End If
Set oTextFile = Nothing
Set oFS = Nothing
End Function
Here is one of the example asp code generated:
<% Response.Charset = "UTF-8" %>
<% Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "inline;filename=test.xls"
%>
<html><head><title>Report</title></head><body>
<table cellspacing=0 border="1" width="100%">
<tr height='30'><td bgcolor='YELLOW'> S Survey Id</td></tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
SO*****@VIP.SOHU.NET</td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%"> 123145312</td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
上门服务是没什么可挑剔的,只是电 在出厂时还是要
再严*把关一下,免得双方都浪费宝 时间。上次我们
的那台电脑刚打开就不能运行,后据 修人员讲主板、
显示器都有问题,除*以外,里面的 作系统*本就没
装,连分区都没*式化。后来这一系 都是维修人员装
好的。 </td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
基本上来说在所有的网上保修,我对de ll是最满意的。
有的时候如果不在质保期内dell的收费 有些高。</td>
</tr>
<tr>
<td bgcolor='#fffff8' border="0" width="100%">
对政府行业应该随叫随到,这*有利 在政府采**取
得更大的生意。</td>
</tr>
</table></body></html>
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!