All of a sudden from the past few days we noticed that export to excel and word is not working in classic asp screens. There is no issue with the code to my knowledge. I think it is related to some security update by Microsoft or some other issue. Can any one help me with fixing this issue
Error:
This site can’t be reached
The webpage at /Common/PtSchNoShowsExportToFile.asp?txtFromDt=12/08/2019&txtToDt=01/08/2020&appl=vnd.ms-excel&type=NoShow might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE
Code:
<%@ 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>