在过去的几天里,我们突然发现导出到excel并无法在经典的asp屏幕中使用word。据我所知,代码没有问题。我认为这与Microsoft的某些安全更新或其他问题有关。谁能帮助我解决此问题
错误:
无法访问此网站
位于/Common/PtSchNoShowsExportToFile.asp?txtFromDt=12/08/2019&txtToDt=01/08/2020&appl=vnd.ms-excel&type=NoShow的网页可能暂时关闭或可能已永久移至新的网址。
ERR_INVALID_RESPONSE
代码:
<%@ Language=VBScript %>
<%Response.expires = -1%>
<%
'Change HTML header to specify Excel's MIME content type
Response.Buffer = TRUE
Response.ContentType = "application/" & request("appl")
dim filename
filename = "No Show Report.xls"
filename = Replace(filename, " ", "%20")
Response.AddHeader "Content-Disposition", "attachment;filename="&filename
Function FormatDate(strDate)
dim arrDate
dim length
if (strDate=null) then
FormatDate=strDate
else
arrDate=Split(strDate,"/")
length=UBound(arrDate)
if(length>1) then
if(len(arrDate(0))=1) then
arrDate(0)="0" + arrDate(0)
end if
if(len(arrDate(1))=1) then
arrDate(1)="0" + arrDate(1)
end if
FormatDate=arrDate(0) +"/" + arrDate(1) + "/" + arrDate(2)
else
FormatDate=strDate
end if
end if
End Function
%>
<HTML>
<body>
<%
'--Connection String
set Cnn = server.CreateObject("ADODB.connection")
Cnn.ConnectionString = Application("MyConnectionStringGoesHere")
Cnn.open
set rs = Cnn.Execute("Sp_Report_ScheduleV4_NoShows @StartDate='" & request("txtFromDt") & "',@EndDate='" & request("txtToDt") & "'")
%>
<TABLE WIDTH = 75% BORDER=1 CELLSPACING=1 CELLPADDING=1>
<TR>
<TD><font size=+2>Provider</TD>
<TD><font size=+2>Date & Time</TD>
<TD><font size=+2>Day</TD>
<TD><font size=+2>Site</TD>
<TD><font size=+2>Reason</TD>
<TD><font size=+2>Chart</TD>
<TD><font size=+2>Name</TD>
<TD><font size=+2>Type</TD>
<TD><font size=+2>Home#</TD>
<TD><font size=+2>work#</TD>
<TD><font size=+2>Cancel Reason</TD>
</TR>
<% Do while not rs.EOF %>
<TR>
<TD><%=trim(rs("ProvName"))%></TD>
<TD><%=FormatDate(rs("AppSDate"))%></TD>
<TD><%=weekdayName(rs("DOW"),true)%></TD>
<TD><%=trim(rs("LocCity"))%></TD>
<TD><%=rs("Reason")%></TD>
<TD><%=rs("pt_id")%></TD>
<TD><%=rs("ptName")%></TD>
<TD><%=rs("Type")%></TD>
<TD><%=rs("PtHomePhone")%></TD>
<TD><%=rs("PtWorkPhone")%></TD>
<TD><%=rs("CancelReason")%></TD>
</TR>
<%
rs.MoveNext
Loop
rs.Close
set rs = Nothing
%>
</TABLE>
</BODY>
</HTML>